Re: Can someone have a look at my pg_hba.conf file ?

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Steven De Vriendt <gisaalter(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can someone have a look at my pg_hba.conf file ?
Date: 2007-06-05 14:32:45
Message-ID: 1181053965.15764.318.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2007-06-04 at 17:05 +0200, Steven De Vriendt wrote:
> Hi,
>
> I'm trying to reach my postgres database via a remote connection. Yet
> my connection is refused when I try to do that.
> I'm using Ubuntu Feisty
> Following lines are now in my pg_hba.conf-file:
...
> # Connections for all PCs on the subnet
> #
> # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
> local all all 127.0.0.1/32 255.255.255.0 trust

That should be "host", not "local". Local means unix sockets on the
same machine. Secondly, 127.0.0.1 is itself only the local machine.
Third, if you specify a CIDR address (with /nn) you don't specify a mask
as well. You want something like "192.168.1.0/24" rather than
"127.0.0.1/32 255.255.255.0".

> When I try the following command:
>
> netstat -nlp | grep 5432
>
> I see my subnet mask isn't included:
>
> root(at)gis-webserver:~# netstat -nlp | grep 5432
> tcp 0 0 127.0.0.1:5432 0.0.0.0:*
> LISTEN 8292/postmaster
> unix 2 [ ACC ] STREAM LISTENING 27162
> 8292/postmaster /var/run/postgresql/.s.PGSQL.5432

As Tom has already said, change listen_addresses in postgresql.conf and
restart the postmaster. If you were connecting with the pg_hba.conf you
have listed, you should be seeing:

psql: FATAL: missing or erroneous pg_hba.conf file
HINT: See server log for details.

>
> Can someone help me out ?
>
> Thanks !
>
> Steven
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
--
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
Do you want to know God? http://www.lfix.co.uk/knowing_god.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marko Kreen 2007-06-05 14:39:36 Re: Encrypted column
Previous Message Ron Johnson 2007-06-05 14:28:00 Re: Encrypted column