Re: IDENT and pg_hda.conf

From: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>
To: "Jerome Lyles" <susemail(at)hawaii(dot)rr(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: IDENT and pg_hda.conf
Date: 2004-01-30 21:46:33
Message-ID: 71E37EF6B7DCC1499CEA0316A256832801057642@loki.wc.globexplorer.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Not sure if I am following your current difficulty, but if you want users on another server to conenct you'll need to make sure your postmaster was started with the "-i" option (to allow TCP/IP connections) and edit the pg_hba.conffile to add the user name, db, IP address and sub mask, for example:

host all all 12.4.12.0 255.255.255.0 trust

This line will let anybody from our 12.4.12 network connect to this instance of postgres, to any database.

You'll need to restart postgres after changing thefile to make it see the changes.

HTH,

Greg Williamson
DBA
GlobeXplorer LLC

-----Original Message-----
From: Jerome Lyles [mailto:susemail(at)hawaii(dot)rr(dot)com]
Sent: Fri 1/30/2004 12:23 PM
To: pgsql-general(at)postgresql(dot)org
Cc:
Subject: Re: [GENERAL] IDENT and pg_hda.conf

On Friday 30 January 2004 01:37 am, Paul Thomas wrote:
> On 30/01/2004 09:39 Susemail wrote:
> > [snip]
> > In any case I don't have a pg_hba.conf file:
>
> You should have, unless you haven't done an initdb...
>
True, I hadn't done an initdb:

postgres(at)linux:/home/adriel> /usr/bin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.

fixing permissions on existing directory /usr/local/pgsql/data... ok
creating directory /usr/local/pgsql/data/base... ok
creating directory /usr/local/pgsql/data/global... ok
creating directory /usr/local/pgsql/data/pg_xlog... ok
creating directory /usr/local/pgsql/data/pg_clog... ok
selecting default max_connections... 100
selecting default shared_buffers... 1000
creating configuration files... ok
creating template1 database in /usr/local/pgsql/data/base/1... ok
initializing pg_shadow... ok
enabling unlimited row size for system tables... ok
initializing pg_depend... ok
creating system views... ok
loading pg_description... ok
creating conversions... ok
setting privileges on built-in objects... ok
creating information schema... ok
vacuuming database template1... ok
copying template1 to template0... ok

Success. You can now start the database server using:

Still not able to authenticate:

postgres(at)linux:/home/adriel> /usr/bin/postmaster -D /usr/local/pgsql/data
LOG: database system was shut down at 2004-01-30 08:47:05 HST
LOG: checkpoint record is at 0/9B1058
LOG: redo record is at 0/9B1058; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 534; next OID: 17142
LOG: database system is ready
FATAL: IDENT authentication failed for user "adriel"
FATAL: IDENT authentication failed for user "adriel"
FATAL: IDENT authentication failed for user "postgres"
FATAL: IDENT authentication failed for user "postgres"

My pg_hba.conf file configuration: Is it correct?

# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD

local all all trust
# IPv4-style local connections:
#host all all 127.0.0.1 255.255.255.255 trust
# IPv6-style local connections:
#host all all ::1
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust
#local all all ident
sameuser

This is my user list:

:~> psql -l
List of databases
Name | Owner | Encoding
-----------+----------+-----------
mydb | postgres | SQL_ASCII
mydb1 | adriel | SQL_ASCII
mydb2 | postgres | SQL_ASCII
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
test | postgres | SQL_ASCII
(6 rows)

So...what am I still doing wrong?
Thanks,
Jerome

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

Browse pgsql-general by date

  From Date Subject
Next Message Anony Mous 2004-01-30 22:03:35 Two joins on same foreign key
Previous Message Rick Gigger 2004-01-30 21:36:28 Re: Triggers, Stored Procedures, PHP. was: Re: PostgreSQL