Thread: Login Problems.

Login Problems.

From
"John Clark L. Naldoza"
Date:
Hello,


I have my PostgreSQL configured as follows:

/usr/bin/postmaster
-p 5432
-D /var/lib/pgsql/data
-B 64
-b /usr/bin/postgres
-i
-N 32


and the pg_hba.conf file has the following lines in it:

local        all         crypt
host         all         127.0.0.1     255.255.255.255     crypt


Now when I try to connect to a database (locally) using psql I get the
following:


psql: Password authentication failed for user 'postgres'


what am I missing here?  ;-)

Thanks in advance.



Cheers,



John Clark

Re: Login Problems.

From
"Adam Lang"
Date:
For the local all, should that just be trust?  Nothing is being sent over
the network, so it shouldn't matter, right?

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
----- Original Message -----
From: "John Clark L. Naldoza" <njclark@ntsp.nec.co.jp>
To: <pgsql-general@postgresql.org>
Sent: Thursday, September 28, 2000 10:19 PM
Subject: [GENERAL] Login Problems.


> Hello,
>
>
> I have my PostgreSQL configured as follows:
>
> /usr/bin/postmaster
> -p 5432
> -D /var/lib/pgsql/data
> -B 64
> -b /usr/bin/postgres
> -i
> -N 32
>
>
> and the pg_hba.conf file has the following lines in it:
>
> local        all         crypt
> host         all         127.0.0.1     255.255.255.255     crypt
>
>
> Now when I try to connect to a database (locally) using psql I get the
> following:
>
>
> psql: Password authentication failed for user 'postgres'
>
>
> what am I missing here?  ;-)
>
> Thanks in advance.
>
>
>
> Cheers,
>
>
>
> John Clark


Re: Login Problems.

From
Tom Lane
Date:
>> and the pg_hba.conf file has the following lines in it:
>>
>> local        all         crypt
>> host         all         127.0.0.1     255.255.255.255     crypt
>>
>> Now when I try to connect to a database (locally) using psql I get the
>> following:
>>
>> psql: Password authentication failed for user 'postgres'

Well, you are specifying crypt (ie, password-based) authentication,
so this is hardly an unexpected message.  If you look in the
postmaster's logfile (whereever you redirected its stdout/stderr to;
do not start it with -S if you want a logfile) then there should be
additional information about the authentication failure.  For obvious
security reasons the postmaster doesn't report everything it knows to
the rejected client, but it tells more in the log.

I'm betting that you forgot to set up a password for the postgres user.
You will need to use a non-password-based auth mechanism at least for
long enough to set the password --- or use one of the variant setups
where the passwords are kept in a separate flat file rather than in the
database (see pg_passwd).

            regards, tom lane