Обсуждение: encrypt psql password in unix script

Поиск
Список
Период
Сортировка

encrypt psql password in unix script

От
Suresh Raja
Дата:
Hi:

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.

Thanks,
-SR

Re: encrypt psql password in unix script

От
Steve Midgley
Дата:
My suggestion is to put it in an environment variable and set that variable from a shell startup script that is secured with permissions. (http://www.postgresql.org/docs/9.4/static/libpq-envars.html)

If you can't do that, the only other method I've used is to setup Postgres with Ansible, and store the Pg passwords in an ansible vault, which is encrypted. Ansible asks for the decrypt key when it runs.

Steve


On Wed, Jul 8, 2015 at 11:34 AM, Suresh Raja <suresh.rajaabc@gmail.com> wrote:
Hi:

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.

Thanks,
-SR

Re: [GENERAL] encrypt psql password in unix script

От
Xavier Stevens
Дата:
I use envcrypt for things like this locally. Just encrypt the file with your own PGP key.


On Wed, Jul 8, 2015 at 12:01 PM, Steve Midgley <science@misuse.org> wrote:
My suggestion is to put it in an environment variable and set that variable from a shell startup script that is secured with permissions. (http://www.postgresql.org/docs/9.4/static/libpq-envars.html)

If you can't do that, the only other method I've used is to setup Postgres with Ansible, and store the Pg passwords in an ansible vault, which is encrypted. Ansible asks for the decrypt key when it runs.

Steve


On Wed, Jul 8, 2015 at 11:34 AM, Suresh Raja <suresh.rajaabc@gmail.com> wrote:
Hi:

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.

Thanks,
-SR