Re: Remote connection issues

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Aritz Dávila <aritz(dot)davila(at)axios(dot)es>
Subject: Re: Remote connection issues
Date: 2011-06-23 13:09:44
Message-ID: 201106230609.44688.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, June 23, 2011 12:24:12 am Aritz Dávila wrote:
> Hi list,
>
> I have installed postgresql 8.4 on Ubuntu server 10.4. I would like to have
> remote access to this database so after reading I found out that modifying
> pg_hba.conf and postgresql.conf will allow me to access remotely.
>
> The postgresql database is on 192.168.2.122. The port 5432 is open, checked
> it with nmap -p1-65535 localhost. The server is comunicating with other
> pcs from the subnet, I can connect to it through ssh.
>
> Here is what I have done:
> I enabled the following on the postgresql.conf file:
> listen_addresses = '*'
> port = 5432
>
> My subnet is under 192.168.2.xxx so I added the following to the
> pg_hba.conf: host all all 192.168.2.0/32 trust
>
> I have also tried adding the IP of the pc which I'm connecting:
> host all all 192.168.2.20/32 trust
>
> and also like this:
> host all all 192.168.2.20 255.255.255.0 trust
>
> After doing all this things, if I try to connect remotely I got a
> connection refused error.
> psql -h 192.168.2.122 -d database
> psql: could not connect to server: Connection refused
> Is the server running on host "192.168.2.122" and accepting
> TCP/IP connections on port 5432?
>
> Another strange thing is the following one, if I do the following on the
> database server: psql -h localhost -d database, I grant access but if I do
> the following psql -h 192.168.2.122 -d database on the database server, I
> got a connection refused error.
>
> Any idea on what I have miss or did wrong?

Did you do a pg_ctl reload, or in the case of listen_addresses pg_ctl restart?

>
> Cheers,
>
> Aritz Davila
> www.axios.es

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2011-06-23 13:25:27 Re: autovacuum ignores some tables
Previous Message Gábor Farkas 2011-06-23 13:07:16 Re: autovacuum ignores some tables