pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: aditya desai <admad123@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: How to encrypt database password in pgpass or unix file to run batch jobs through shell script
Date: Fri, 25 Sep 2020 15:51:47 -0400
Message-ID: <20200925195147.GC7206@momjian.us> (raw)
In-Reply-To: <CAN0SRDE14BxP14kL=DMTPrvJYbTpg=9wHYucx+=p1kfmKZnFEw@mail.gmail.com>
References: <CAN0SRDE14BxP14kL=DMTPrvJYbTpg=9wHYucx+=p1kfmKZnFEw@mail.gmail.com>

On Fri, Sep 25, 2020 at 03:04:56PM +0530, aditya desai wrote:
> Hi,
> We have Amazon RDS Postgres. Currently we are using .pgpass file and running
> psql from different EC2 instances to connect to DB. But the password in this
> file is not encrypted. What are our options to encrypt the password? Or do
> passwordless connection from EC2 to database? Lambda functions have limitations
> of running only for 15 minutes.
> 
> How can we setup different authentication methods for AWS RDS Postgres as we
> don't have access pg_hba.conf?

There is no encryption facility, though you can used the hashed value
rather than the literal password.  To encrypt, you would need to decrypt
it and then pass it to libpq, but there is no _pipe_ facility to do
that.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






view thread (2+ messages)

Message-ID: <20200925195147.GC7206@momjian.us>
Permalink:  ../20200925195147.GC7206@momjian.us/
Also on:    postgresql.org/message-id/20200925195147.GC7206@momjian.us

 · 

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-performance@postgresql.org
  Cc: bruce@momjian.us, admad123@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: How to encrypt database password in pgpass or unix file to run batch jobs through shell script
  In-Reply-To: <20200925195147.GC7206@momjian.us>

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

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