agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: pgsql-general@postgresql.org
Subject: Re: encrypt psql password in unix script
Date: Wed, 8 Jul 2015 11:46:23 -0700
Message-ID: <559D6FFF.5070903@hogranch.com> (raw)
In-Reply-To: <CAJP7dtBTkFiF4h6E9jWKToBjRrRmVNWrEan5EmpGK+oBvt_4sQ@mail.gmail.com>
References: <CAJP7dtBTkFiF4h6E9jWKToBjRrRmVNWrEan5EmpGK+oBvt_4sQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

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



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (6+ messages)  latest in thread

Message-ID: <559D6FFF.5070903@hogranch.com>
Permalink:  ../559D6FFF.5070903@hogranch.com/
Also on:    postgresql.org/message-id/559D6FFF.5070903@hogranch.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pierce@hogranch.com, pgsql-general@postgresql.org
  Subject: Re: encrypt psql password in unix script
  In-Reply-To: <559D6FFF.5070903@hogranch.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox