Thread: Allowing a connection from other client in the network

Allowing a connection from other client in the network

From
"Oliveiros Cristina"
Date:
Hello, All,
 
I need to allow access to the postgres server(windows) from a remote machine (10.61.90.231).
 
I changed the postgresql.conf to include the line :

listen_addresses = 'localhost,10.61.90.231'  # what IP address(es) to listen on;
 
 
And I changed the pg_hba.conf file (also on data dir) so now  it has a line like this
 
host    all         all         10.61.90.0/24          md5
 
 
And I rebooted the machine, but the server keeps on refusing actively connections.
 
Do I have to change any file besides these two ?
 
Help...
 
Many thanks in advance
 
Best,
Oliveiros

Re: Allowing a connection from other client in the network

From
Tom Lane
Date:
"Oliveiros Cristina" <oliveiros.cristina@marktest.pt> writes:
> I need to allow access to the postgres server(windows) from a remote
> machine (10.61.90.231).

> I changed the postgresql.conf to include the line :

> listen_addresses = 'localhost,10.61.90.231'  # what IP address(es) to listen on;

This is incorrect.  listen_addresses must specify the interface
addresses of your *own* machine, not some other one.  Usually if you
want to allow remote connections, you should just set it to '*' and let
the postmaster figure out what the machine's IP address(es) are.

> And I changed the pg_hba.conf file (also on data dir) so now  it has a line like this

> host    all         all         10.61.90.0/24          md5

This part's OK.

You might also have a third problem: if the machine has any sort of
firewall software, the firewall might need to be adjusted to let in
remote connections to port 5432.

            regards, tom lane

Re: Allowing a connection from other client in the network

From
"Oliveiros Cristina"
Date:
Your solution worked perfectly, Tom.

Thanks a million

Best,
Oliveiros

----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Oliveiros Cristina" <oliveiros.cristina@marktest.pt>
Cc: <pgsql-novice@postgresql.org>
Sent: Monday, September 24, 2007 4:29 PM
Subject: Re: [NOVICE] Allowing a connection from other client in the network


> "Oliveiros Cristina" <oliveiros.cristina@marktest.pt> writes:
>> I need to allow access to the postgres server(windows) from a remote
>> machine (10.61.90.231).
>
>> I changed the postgresql.conf to include the line :
>
>> listen_addresses = 'localhost,10.61.90.231'  # what IP address(es) to
>> listen on;
>
> This is incorrect.  listen_addresses must specify the interface
> addresses of your *own* machine, not some other one.  Usually if you
> want to allow remote connections, you should just set it to '*' and let
> the postmaster figure out what the machine's IP address(es) are.
>
>> And I changed the pg_hba.conf file (also on data dir) so now  it has a
>> line like this
>
>> host    all         all         10.61.90.0/24          md5
>
> This part's OK.
>
> You might also have a third problem: if the machine has any sort of
> firewall software, the firewall might need to be adjusted to let in
> remote connections to port 5432.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>