1

I am running Postgres 9.1 on Ubuntu. I have host all all my.ip.address/32 md5 set in pg_hba.conf and listen_addresses= '*' set in postgresql.conf. Running show listen_addresses shows '*' Running sudo netstat -ltnp | grep postgres shows

tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      28899/postgres
tcp6       0      0 :::5432                 :::*                    LISTEN      28899/postgres

However, I sill cannot connect to the DB using pgAdmin III on my machine that is located at "my.ip.address". What could I have missed in the set up?

Thank you.

2
  • 1
    What error message do you get in Pgadmin ? What if you try psql -h your.server.ip -U youruser -d yourdatabase -W from your client machine ? Is there any firewall inbetween ?
    – alci
    Apr 21, 2014 at 9:12
  • 1
    Thank you for your comment, it made me realize one thing I did NOT check. The problem turned out to be a blocked OUTGOING port on my network. Thank you for taking the time to comment!
    – MrMMM
    Apr 21, 2014 at 13:48

1 Answer 1

1

You have to configure the following two files

pg_hba.conf

host all all 0.0.0.0/0 md5

postgresql.conf

listen_addresses='*'

Make sure to restart postgres service after changing the files.

You have to check if the port 5432 is open: http://www.yougetsignal.com/tools/open-ports/

If it's not then add a rule to your iptables:

iptables -A INPUT -s 0/0 -p tcp --dport 5432 -j ACCEPT

0/0: If you want anybody to access it. You can change it to a specific IP address or range of IP addresses.

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.