Re: encrypt psql password in unix script

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: encrypt psql password in unix script
Date: 2015-07-08 18:46:23
Message-ID: 559D6FFF.5070903@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On 7/8/2015 11:34 AM, Suresh Raja wrote:
> I cannot use .pgpass as the password stored here is not encrypted.
>
> can i use a encrypted password from unix shell script. has anybody
> ran into same situation. Wht options do i have.

I believe anywhere you enter a password in postgres, it can be the hash
instead.

but what security does that gain you? if someone gets your
encrypted/hashed password, he can still log on. the pgpass file has to
be permissions 700, so only YOU (and root) can read it.

if these are LOCAL connections to a pg server on the same machine, you
can use 'ident' as your authentication, where your unix user is used as
the postgres username. or, you can use ssl certificates for
authentication, this is more complex to setup.

--
john r pierce, recycling bits in santa cruz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Midgley 2015-07-08 19:01:02 Re: encrypt psql password in unix script
Previous Message Suresh Raja 2015-07-08 18:34:44 encrypt psql password in unix script

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Midgley 2015-07-08 19:01:02 Re: encrypt psql password in unix script
Previous Message Suresh Raja 2015-07-08 18:34:44 encrypt psql password in unix script