From: Alvaro Aguayo Garcia-Rada <aaguayo@opensysperu.com>
To: pgsql-admin@postgresql.org, pgsql-admin@lists.postgresql.org, Azimuddin Mohammed <azimeiu@gmail.com>
Subject: RE: Postgres user password
Date: Wed, 21 Feb 2018 22:04:25 -0500 (PET)
Message-ID: <qban05telj3fc8cc08bngpgo.1519268651193@email.android.com> (raw)
In-Reply-To: <CAKUuFd7RyAQEH2-NH8rXNkc-_36LifpDmLjXjmMZ30=75dPfxA@mail.gmail.com>
References: <CAKUuFd7t49TPfA5S8ExhOSNhrMrhz9GTTvnJBu_Sj7LaBshytA@mail.gmail.com>
<CAKUuFd7q3_aLSJvwQFyPYHf=oKG87=0YSDQCuKRJvng4oNiUqA@mail.gmail.com>
<CAKUuFd5XjVqp7in=23X=z7FpG_A83xTpcW10CnPOt9YxAarmtw@mail.gmail.com>
<CAKUuFd6QQsuxE-Jkoqcd1Wb6PSiMUPmiCLWuSdLFxSSx695Fqg@mail.gmail.com>
<CAKUuFd5-ZRFaL1M1KsPz85Gid4E7MBGV+SB3eXd-akbKXwFsSA@mail.gmail.com>
<CAKUuFd7RyAQEH2-NH8rXNkc-_36LifpDmLjXjmMZ30=75dPfxA@mail.gmail.com>
There are some possible solutions:
- .pgpass file, which permissions can be changed so only owner can read it
- PGPASS environment variable. Don't discard it right away, because don't have to set this variable pn the script itself; you can set it into your .bash_profile, and change its permissions so only owner can read it. You can even use some openssl commands so that it is never stored in clear text.
- Playing a bit with pg_hba.conf . You can use "trust" authentication for UNIX socket connections, or create a user intended only for backup(read only access) with "trust" authentication for the specific database for UNIX socket or localhost connections. With this, you won't have to use a password.
- Further on the pg_hba.conf tricks, you can create a postgres user with the same name as the linux user running your tasks, and add a line for such user with "ident" authentication, so the user will not require password only if the task is running as such linux user and using UNIX socket connection.
Regards,
Alvaro Aguayo
Jefe de Operaciones
Open Comb Systems E.I.R.L.
Oficina: (+51-1) 3377813 | RPM: #034252 / (+51) 995540103 | RPC: (+51) 954183248
Website: www.ocs.pe
Sent from my Sony Xperia™ smartphone
---- Azimuddin Mohammed wrote ----
Hello,
I have setup my postgres server with postgres as a super user with
password. Everytimg when i connect to postgress as super user i have to
login with password. My question is how can I automate the scripts for back
up and restore that will require password while taking backup or doing
restore. We do not want to store the password in the script due to security
concerns. Is there a way to do ?
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-admin@postgresql.org
Cc: aaguayo@opensysperu.com, azimeiu@gmail.com
Subject: RE: Postgres user password
In-Reply-To: <qban05telj3fc8cc08bngpgo.1519268651193@email.android.com>
* 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