On 04/26/13 20:25, James Cloos wrote:
"J" == Joseph <syscon...@gmail.com> writes:
J> In my "pg_hba.conf" I have:
J> local all all trust
J> host all all 127.0.0.1/32 trust
J> I was under impression that this is configuration is for localhost
"127.0.0.1" access only.
That tells pg how to authenticate users using the unix domain socket and
users using tcp over the loopback interface.
To limit the listen_address, edit postgresql.conf in that directory.
You want to have:
listen_addresses = 'localhost'
or:
listen_addresses = '127.0.0.1'
to prevent any access attempts from any non-localhost ip addresses.
-JimC
--
James Cloos <cl...@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
Thanks James for your help.
I'll explain what am doing and trying to accomplish.
On my sever (local desktop box) I run postgresql and have access to all
databases.
I'm using sql-ledger program, which uses firefox via apache to access
postgresql. In apache I can easily control which IP has access to my box, this
is not a problem.
Postgresql has a user "sql-ledger" and I don't wont to create new users.
sql-ledger has access to two databases.
On localhost (where postgresql is running) I want to have access to both
databases (eg. db1 and db2)
but I want to limit access from other computers on the network to only one
database.
Is it possible?
I've tried various combination in pg_hba.conf but nothing works.
The first line line in pg_hba.conf (below) will allow connection to both databases (db1 and db2) to a box that I'll allow via apache to access postgresql.
local all sql-ledger trust
the line below will have no effect
host clinic sql-ledger 192.168.139.1/32 trust
How do I limit IP 192.168.139.1 to only one database and have full access from
localhost to both databases.
Thank you for your help!
--
Joseph