Skip site navigation (1) Skip section navigation (2)

Re: pg_hba.conf is driving me nuts

From: "Usama Dar" <munir(dot)usama(at)gmail(dot)com>
To: "Klay Martens" <kmartens(at)wol(dot)co(dot)za>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_hba.conf is driving me nuts
Date: 2007-12-16 19:27:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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, you should get something like

telnet 5432
Connected to (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

> 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             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(at)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
Consultant Architect
Cell:+92 321 5020666
Skype: usamadar

In response to

pgsql-admin by date

Next:From: Usama DarDate: 2007-12-16 19:37:19
Subject: Re: reading pg_stat_activity view
Previous:From: Peter EisentrautDate: 2007-12-16 13:57:39
Subject: Re: pg_hba.conf is driving me nuts

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group