0
votes

I cannot connect to my postgresql instance remotely on port 5432. Connection times out. I cannot connect remotely using psql, pgAdmin or telnet. I feel like I have everything configured correctly. Postgresql has been restarted several times with these settings. Remote connection works fine.

What could I be missing?

netstat: enter image description here enter image description here

postgressql.conf enter image description here

pg_hba.conf: enter image description here

2

2 Answers

0
votes

Try referring this link for help https://www.thegeekstuff.com/2014/02/enable-remote-postgresql-connection/?utm_source=tuicool

in short you have to the following steps 1. Add the following line to the pg_hba.conf server. This will allow connection from “192.168.xxx.xx” ip-address (This is the client ip)

  # vi  /var/lib/pgsql/data/pg_hba.conf
  host    all         all         192.168.xxx.xx/xx    trust
  1. Change the Listen Address in postgresql.conf

    # grep listen /var/lib/pgsql/data/postgresql.conf listen_addresses = '*'

  2. Test the Remote Connection

0
votes

You just need to change the method md5 to trust and and enter the address as 0.0.0.0/0.

Open the config file

vi  /var/lib/pgsql/data/pg_hba.conf

Insert the following line

host    all         all         0.0.0.0/0    trust

Maybe it will work.