AJ_NOVICE
AJ_NOVICE

Reputation: 321

Unable to connect to postgres DB via vpn || Able to connect to the postgres server via putty

I am trying to connect to a postgres DB over VPN using Pgadmin. But seeing the error : FATAL: no pg_hba.conf entry for host "172.18.232.207", user "postgres", database "prod1_db", SSL off

172.18.232.207 is the ip allocated to my system by vpn. Reading some community threads I added "host all all 0.0.0.0/0 trust" to the pg_hba.conf file and listen_addresses = '*' to the postgresql.conf and restarted my system but still it did not help and I am still seeing the error. Any suggestion would be of great help to get this through.

Upvotes: 1

Views: 8235

Answers (2)

AJ_NOVICE
AJ_NOVICE

Reputation: 321

Thanks team for the help...I got postgres installed on my unix server >>made the entry for all host but with md5 hash >>reloaded the config>>done!! :)

Upvotes: 0

Lee James
Lee James

Reputation: 379

you need to edit your pg_hba.conf file again and remove the host all all 0.0.0.0/0 trust entry! That is very very bad! It allows anyone to connect to any database from any machine using any account with no password. Why on earth would you want to allow that ever?!

You should have an entry like this:

host all all 172.18.232.207/32 md5

That will allow your machine to connect by password authentication. You should check you always get the same VPN IP address though - most networks will assign an IP from a range for VPN connections. You will have to adjust the CIDR address accordingly.

Upvotes: 3

Related Questions