Search code examples
postgresqlpgadmin

Access remote Postgres server with pgAdmin


I've got pgAdmin running on my XP machine. There's a Centos machine running a Postgres server on the network. The Postgres server pg_hba.conf file has the following lines

TYPE      DATABASE    USER      CIDR-ADDRESS       METHOD
host      all         all       10.0.0.68/32       trust
local     mydb        myuser                       password
local     all         postgres                     ident
host      mydb        myuser    10.0.0.68/32       password
host      all         postgres  10.0.0.68/32       trust

My postgresql.conf file has the following line:

listen_address = 'localhost, 10.0.20.10'

nmap -sS 10.0.20.10 shows:

PORT      STATE     SERVICE
5432/tcp  open      postgresql

I can ssh into a bash shell on the server, but I can't connect with pgAdmin. I get the following:

could not connect to server: No route to host(0x00002751/10065) Is the server running on host "10.0.20.10" and accepting TCP/IP connections on port 5432?

I've no idea what the problem is.


Solution

  • @Aidan found the solution himself:

    It was a firewall issue.

    service iptables stop
    

    enabled the connection. I'll just write a rule to allow the connection.