Re: pg_hba.conf is driving me nuts - Mailing list pgsql-admin

From Usama Dar
Subject Re: pg_hba.conf is driving me nuts
Date
Msg-id ff0e67090712161127r6a940db2v4c31ea68cc5b31bd@mail.gmail.com
Whole thread Raw
In response to pg_hba.conf is driving me nuts  ("Klay Martens" <kmartens@wol.co.za>)
List pgsql-admin



Now, I have set up all the appropriate port forwarding, made sure that there
are no problems with firewalls on the server.

Just to make sure there really is no issue with firewall did you try something like telnet on postgres host and port , like telnet buggy.pg.net 5432, you should get something like

telnet buggy.pg.net 5432
Trying buggy.pg.net...
Connected to buggy.pg.net.unknowndomain (some ip)
Escape character is '^]'.

i mean inorder for you to be able to directly connect to the postgres  over WAN, you will need to open the postgres port  and you should be able to remotely access it, just like you would open ports for ssh and ftp and other utilities.


I am fairly sure this is a result of a problem with pf_hba.conf.Can anyone
advise how to configure pg_hba.conf to permit connections from any subnet
and ip?

If there is no issue with firewall and the port is open the following should do it

host    all         all         0.0.0.0/0             trust

if you want to avoid opening the port for security reasons use ssh tunneling, or port forwarding something like following

ssh -L 2525:localhost:5432 user@remotehost

this will map the local 2525 port onto the remote hosts 5432 port, now you can simply connect to the postgres like a local instance

psql -h localhost -p 2525 -U postgres




--
Usama Munir Dar http://linkedin.com/in/usamadar
Consultant Architect
Cell:+92 321 5020666
Skype: usamadar

pgsql-admin by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_hba.conf is driving me nuts
Next
From: "Usama Dar"
Date:
Subject: Re: reading pg_stat_activity view