Re: pg_hba.conf is driving me nuts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux