Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eohBH-0002RT-Um for pgsql-admin@arkaria.postgresql.org; Thu, 22 Feb 2018 03:04:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eohBG-0007z0-Iz for pgsql-admin@arkaria.postgresql.org; Thu, 22 Feb 2018 03:04:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eohBG-0007yq-8H for pgsql-admin@lists.postgresql.org; Thu, 22 Feb 2018 03:04:22 +0000 Received: from adriana.opensysperu.com ([2607:5300:60:8392::1004]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eohBC-000395-Hr for pgsql-admin@postgresql.org; Thu, 22 Feb 2018 03:04:21 +0000 Received: from localhost (localhost [IPv6:::1]) by adriana.opensysperu.com (Postfix) with ESMTP id A4539C2229; Wed, 21 Feb 2018 22:04:27 -0500 (-05) Received: from adriana.opensysperu.com ([IPv6:::1]) by localhost (adriana.opensysperu.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id 7iSn_Gzxjd6O; Wed, 21 Feb 2018 22:04:25 -0500 (-05) Received: from localhost (localhost [IPv6:::1]) by adriana.opensysperu.com (Postfix) with ESMTP id 8279BC222A; Wed, 21 Feb 2018 22:04:25 -0500 (-05) X-Virus-Scanned: amavisd-new at opensysperu.com Received: from adriana.opensysperu.com ([IPv6:::1]) by localhost (adriana.opensysperu.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id pFqXGQcVoJRU; Wed, 21 Feb 2018 22:04:25 -0500 (-05) Received: from adriana.opensysperu.com (adriana.opensysperu.com [158.69.30.115]) by adriana.opensysperu.com (Postfix) with ESMTP id 4B691C2229; Wed, 21 Feb 2018 22:04:25 -0500 (-05) Date: Wed, 21 Feb 2018 22:04:25 -0500 (PET) Subject: RE: Postgres user password Message-ID: From: Alvaro Aguayo Garcia-Rada To: pgsql-admin@postgresql.org, pgsql-admin@lists.postgresql.org, Azimuddin Mohammed MIME-Version: 1.0 In-Reply-To: References: Content-Type: multipart/alternative; boundary="----=_Part_146810_1619133922.1519268665109" X-Mailer: Zimbra 8.6.0_GA_1153 (MobileSync - SonyF5122/7.0-EAS-2.0) Thread-Topic: Postgres user password Thread-Index: Hy16oRYf9tDj+0KAYck2SMwzKGbLOw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_146810_1619133922.1519268665109 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 h= ave to set this variable pn the script itself; you can set it into your .ba= sh_profile, and change its permissions so only owner can read it. You can e= ven 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 U= NIX socket connections, or create a user intended only for backup(read only= access) with "trust" authentication for the specific database for UNIX soc= ket 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 th= e same name as the linux user running your tasks, and add a line for such u= ser 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)=C2=A03377813=C2=A0| RPM: #034252 / (+51)=C2=A0995540103=C2= =A0 | RPC: (+51)=C2=A0954183248 Website:=C2=A0www.ocs.pe Sent from my Sony Xperia=E2=84=A2 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 ? ------=_Part_146810_1619133922.1519268665109 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
There are some possible solutions:

- .pgpass file, = which permissions can be changed so only owner can read it
- PGPASS envi= ronment variable. Don't discard it right away, because don't have t= o set this variable pn the script itself; you can set it into your .bash_pr= ofile, and change its permissions so only owner can read it. You can even u= se some openssl commands so that it is never stored in clear text.
- Pla= ying a bit with pg_hba.conf . You can use &= quot;trust" authentication for UNIX socket connections, or create a us= er intended only for backup(read only access) with "trust" authen= tication for the specific database for UNIX socket or localhost connections= . With this, you won't have to use a password.
- Further on the pg_<= a href=3D"http://hba.conf">hba.conf tricks, you can create a postgres u= ser 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 U= NIX socket connection.

Regards,

Alvaro Aguayo
Jefe de Oper= aciones
Open Comb Systems E.I.R.L.

Oficina: (+51-1)=C2=A03377813=C2=A0| RPM: #034252 /= (+51)=C2=A0995540103=C2=A0 | RPC: (+51)=C2= =A0954183248
Website:=C2=A0www.ocs.pe

Sent from my Sony Xperia=E2=84=A2 smar= tphone

---- Azimuddin Mohammed wrote ----


Hello,
I have setup my postgres server with = postgres as a super user with password. Everytimg when i connect to postgre= ss as super user i have to login with password. My question is how can I au= tomate 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 th= e script due to security concerns. Is there a way to do ?
------=_Part_146810_1619133922.1519268665109--