I want to connect to a machine running postgresql 9.3. The machine itself is not reachable via a direct IP but is in a LAN with another machine with a public IP address.

My current approach is:

changing postgresql.conf:

listen_addresses = '*'
port = 5432

adding to pg_hba.conf:

host    all        all       trust

(of cause restarting the postgres service)

connecting to the public server via:

ssh -L 9999: user@theip

which works just fine (I am logged in without any error message)

But when I try to connect pgadmin3 using:

name: randomName
Port: 9999
Maintenance DB: postgres
Username: postgres
Pasword: *********
Group: Servers

I get: Server doesn't listen ....

checking sudo netstat -tulpn shows:

tcp        0      0  *               LISTEN      8860/postgres
tcp6       0      0 :::5432                 :::*                    LISTEN      8860/postgres

Therefore postgres seems to listen for LAN addresses though I get a "do not listen".

How do I fix that?

1 Answer 1



host    all        all       trust


host    all        all        samenet       trust

did the trick for me. Though the difference between the two stays a secret for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.