gargoyle60 wrote:
Quote:
I have been looking at connecing to remote databases (all my databases are on the same machine at
localhost).
[...]
I am trying to develop a backup strategy and I want to execute a number of simple SELECT queries
from the main postgres superuser account to acquire certain information before running backups.
However, all of my databases have passwords and obviously I don't want to have to specify passwords
in scripts if I can avoid it.
So, is there a way to temporarily remove (then reinstate) server password authentication when
running as postgres? |
To answer your last question, if you are user postgres and the database cluster
is local, you can modify pg_hba.conf to "trust" authentication and run "pg_ctl reload".
I don't know what your security concerns are, but temporarily relaxing
authentication checks does not seem such a good idea to me.
Does anybody who is *not* the DBA have shell access to the postgres
account on the server machine? If yes, you are in trouble anyway.
If no, you could consider adding a permanent entry to pg_hba.conf that
allows user postgres to connect *locally* without password, like
local postgres mydb trust
host postgres mydb 127.0.0.1/32 trust
That way you don't have to worry about passwords in administrative
scripts.
Yours,
Laurenz Albe