pg_hba.conf problem? - Mailing list pgsql-general

From Carlo Florendo
Subject pg_hba.conf problem?
Date
Msg-id 00ba01c1b2e3$95501ba0$213b1cac@ntsp.nec.co.jp
Whole thread Raw
Responses Re: pg_hba.conf problem?
Re: pg_hba.conf problem?
List pgsql-general
Hi,

I try to connect to the postgres db from one machine to the other.
If I set the pg_hba.conf authentication entry for the client machine in the server machine to "trust",
one could  connect successfully.  However, if I change the entry into "crypt" or
"password", one couldn't connect  even if the specified password was
typed correctly.

This is how my pg_shadow looks like:


template1=# select * from pg_shadow;
 usename  | usesysid | usecreatedb | usetrace | usesuper | usecatupd | passwd
valuntil
----------+----------+-------------+----------+----------+-----------+--------+
 postgres  |       26 | t           | t        | t        | t         | abc123 |
 amgarcia |       27 | t           | f        | f        | f         | abc123 |
(2 rows)


This one below is part of my pg_hba.conf file:

# This default configuration allows any local user to connect as any
# PostgreSQL username, over either UNIX domain sockets or IP:

host         all         127.0.0.1     255.255.255.255     crypt
host         athena      172.28.61.13  255.255.255.255     trust   amgarcia

# If you want to allow non-local connections, you will need to add more
# "host" records (and don't forget to start the postmaster with "-i"!).


Basically, I want user "amgarcia" to authenticate before connecting to the database.
If I change the "trust" to "crypt", the server asks for a password.  It, however, does
not want to accept the password "abc123".

This is how the client (coolio) connects to the server (tissue) to the database
"athena".

amgarcia@coolio ~$ psql -d athena -h tissue.ntsp.nec.co.jp amgarcia
Password:

I enter the correct password  "abc123"  but I get this message:

psql: Password authentication failed for user 'amgarcia'


If I change "password" or "crypt" into "trust", there is no problem in connecting.
However, this is not what I want.  I want user "amgarcia" to be able to authenticate
first before connecting to the server.

How could I do this?  (I use postgres 7.1.3 under redhat 7.2)

Thanks a lot!!!!!

Carlo  F. Florendo
NEC Telecoms
fcarlo@ntsp.nec.co.jp






pgsql-general by date:

Previous
From: samik@cae.wisc.edu (Samik Raychaudhuri)
Date:
Subject: Re: Install postmaster as service in win2K
Next
From: tony
Date:
Subject: getting currval from a sequence