Running psql commands from a remote location & pg_hba.conf?

From: "Birchall, Austen" <austen(dot)birchall(at)metoffice(dot)gov(dot)uk>
To: "pgsql-novice-owner(at)postgresql(dot)org" <pgsql-novice-owner(at)postgresql(dot)org>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Cc: "Birchall, Austen" <austen(dot)birchall(at)metoffice(dot)gov(dot)uk>
Subject: Running psql commands from a remote location & pg_hba.conf?
Date: 2013-08-05 13:45:44
Message-ID: 4E154FB60786D74BB4DFDC97BF991CAC07602A@EXXCMPD1DAG2.cmpd1.metoffice.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a monitor user that does a SSH from a remote location onto a database's host then runs commands of the form:

/usr/bin/psql -c "SELECT COUNT(*) FROM pg_stat_activity; ;" -U monitor -d db1 -q -A -t

The current pg_hba.conf is

# IPv4 local connections:
host all all 123.0.0.1/32 trust
which is far from ideal!

Am I right to presume that I have to change pg_hba.conf to

host db1 monitor 123.0.0.1/32 trust
host db1 user1 123.0.0.1/32 ident
host db1 user2 123.0.0.1/32 ident

then continue this format with individual entries for all the users in db1?

Or is there a 'better' way of running psql commands from a remote location?

Thanks

Austen

Austen Birchall  Senior Database Administrator, Met Office

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Luca Ferrari 2013-08-05 15:30:44 Re: Running psql commands from a remote location & pg_hba.conf?
Previous Message Luca Ferrari 2013-08-05 13:33:39 Re: General 'big data' advice....