pg_hba.conf and password authentication problem

From: Si Chen <schen(at)graciousstyle(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_hba.conf and password authentication problem
Date: 2004-12-23 20:28:27
Message-ID: 41CB2A6B.8050609@graciousstyle.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I am having a really strange password authentication problem.

I created a user with
$ createuser -W myuser
and a database with
$ createdb mydb

Then, I put in /var/lib/pgsql/data/pg_hba.conf:
host mydb myuser 127.0.0.1 255.255.255.255 password

Yet whenever I try to login to the database using either JDBC or the
command line:
$ psql -W mydb -U myuser -h 127.0.0.1
and enter the correct password (believe me--it was correct!) I get the
psql: FATAL: Password authentication failed for user "myuser"

Could it be a mis-specified IP or netmask combination? I have the exact
same database and user on another server where everything works
properly. (I'm trying to set up a backup server.) On the main server
where the password authentication works, I have in /etc/hosts
127.0.0.1 localhost localhost.localdomain
and a
$ /sbin/ifconfig
gives
lo inet addr: 127.0.0.1 Mask 255.0.0.0

On the backup server, I have in /etc/hosts
127.0.0.1 localhost
and
$ /sbin/ifconfig
lo inet addr: 127.0.0.1 Mask 255.0.0.0

The IP addresses themselves have different netmasks of 255.255.255.248
and 255.255.255.128.

Where should I be looking for the source of this problem? Sorry but I
couldn't find anything about it in the documentation or online and don't
even know where to start.

Thanks in advance!

Si Chen

Browse pgsql-admin by date

  From Date Subject
Next Message Joshua D. Drake 2004-12-24 03:07:58 Re: restore data from DB base?
Previous Message Tom Lane 2004-12-23 19:00:27 Re: VACUUMing for 30 minutes