Re: How to encrypt database password in pgpass or unix file to run batch jobs through shell script

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: aditya desai <admad123(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: How to encrypt database password in pgpass or unix file to run batch jobs through shell script
Date: 2020-09-25 19:51:47
Message-ID: 20200925195147.GC7206@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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(at)momjian(dot)us> https://momjian.us
EnterpriseDB https://enterprisedb.com

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message aditya desai 2020-09-28 15:51:28 Re: AWS RDS PostgreSQL CPU Spiking to 100%
Previous Message aditya desai 2020-09-25 09:34:56 How to encrypt database password in pgpass or unix file to run batch jobs through shell script