Re: pg_hba.conf configuration

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "Paul Wallace" <paul(dot)wallace(at)prosolutions-ap(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Cc: <Dave(at)micro-automation(dot)net>
Subject: Re: pg_hba.conf configuration
Date: 2001-12-19 15:07:51
Message-ID: NEBBLAAHGLEEPCGOBHDGIEIFEBAA.nickf@ontko.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


> Presumably to make a connection to a remote database, I need to start
> the postmaster with the -i switch,

True, but I'd recommend instead adding the line "tcpip_socket = 1" to
postgresql.conf if you are running v 7.1 or higher. This does the same thing
as -i, & keeps you from having to mess with startup scripts

> and configure the pg_hba.conf file? Can
> you tell me what needs to be edited in this file please? A single
> connection...

if your client (appserver host) machine's ip address is 1.2.3.4, you would
add this line to pg_hba.conf:

host all 1.2.3.4 255.255.255.255 trust

This line essentially says: let a *host* connect to *all* databases if the
host's ip address is *1.2.3.4* and *trust* any request from this machine
(don't do any further authorization checks.) The 255.255.255.255 is just the
netmask, so for now, I'm setting it for one machine, but of course you could
make it accept any host on your subnet.

This is the simplest form. To tighten up security a bit, you'll want to
replace "trust" with another authorization method later, but I'm assuming
that for now, you'd just like to see it work. When the time comes to add
security, look here for the auth methods:
http://www.postgresql.org/idocs/index.php?client-authentication.html#PG-HBA.
CONF

-Nick

--------------------------------------------------------------------------
Nick Fankhauser nickf(at)ontko(dot)com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Peter T. Brown 2001-12-20 02:58:37 controlling process priority
Previous Message David Brownlee 2001-12-19 12:14:39 Re: date problem with postgres JDBC 7.1 driver