Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to avoid clear text passwords for connections to PostgreSQL db

51 views
Skip to first unread message

anj patnaik

unread,
Sep 25, 2015, 3:03:34 PM9/25/15
to
Hello all,
I am using Pgtcl to connect to postgreSQL db. Right now, passwords are in Tcl scripts/code files.

I am looking for means to avoid clear text passwords in code/scripts. Are there any mechanisms in Tcl/Pgtcl that you know/used to avoid clear text passwords?

I know oracle has a "wallet" mechanism. Is there any mechanims in pgtcl and postgres that works well for this of purpose.

Thanks a lot!

Rich

unread,
Sep 25, 2015, 3:19:27 PM9/25/15
to
Read the documentation for pgtcl.

Specifically the part about "sslmode".

Robert Heller

unread,
Sep 25, 2015, 4:15:07 PM9/25/15
to
That may not be what the OP needs. I expect that only protects the passwords
in 'transit', but the code/scripts themselves would still have the passwords
in clear text.

>
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

Robert Heller

unread,
Sep 25, 2015, 4:15:07 PM9/25/15
to
PostgreSQL has a way to map UNIX usernames with PostgreSQL users. If you use
this mechanism and then run your scripts as the proper 'user', you don't need
to specifiy usernames or passwords in the code/scripts.

>
> Thanks a lot!

M. Strobel

unread,
Sep 26, 2015, 4:23:40 AM9/26/15
to
You can define your database parameters (host, user, sslmode, ..., not password) in
the file ~/.pg_service.conf which saves you editing the code or program your own
config file.

Additionally you can put passwords in ~/.pgpass which might indeed be saver than in
the code.

Read the pg docs about it, it is well described, but somewhat hidden (search for the
file names)

These nice features depend of course on the usage of the pg client lib (which is the
case in Tcl).

I had this working even for a web server, by putting these files into the web server
home dir.

/Str.
0 new messages