Re: authentication failure

From: Jayadevan M <maymala(dot)jayadevan(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, dinesh kumar <dineshkumar02(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: authentication failure
Date: 2014-01-05 15:47:21
Message-ID: CAFS1N4jYfTZpJmLESC9hLex1051k_TX-meoD=fEjBr_NDmS_VQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

With md5
psql
psql: FATAL: password authentication failed for user "postgres"

with trust
psql -h localhost
psql (9.3.2)
Type "help" for help.

back to md5
psql -h localhost
psql: FATAL: password authentication failed for user "postgres"

But...

find / -name .pgpass
<no file found>

$ env | grep PG
PGPORT=1234
PGUSER=postgres
PGHOST=localhost

On Sun, Jan 5, 2014 at 9:03 PM, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>wrote:

> On 01/04/2014 08:46 PM, Jayadevan M wrote:
>
>> Log entries for 3 situations - 2 successful and one failed attempt -
>>
>> From non-chroot, shell user postgres
>>
>> 2014-01-05 10:11:58 IST [17008]: [2-1] user=postgres,db=postgres LOG:
>> connection authorized: user=postgres database=postgres
>> 2014-01-05 10:12:03 IST [17008]: [3-1] user=postgres,db=postgres LOG:
>> disconnection: session time: 0:00:04.413 user=postgres database=postgres
>> host=::1 port=47944
>>
>>
>> From chroot, shell user root, db user postgres
>> 2014-01-05 10:12:18 IST [17021]: [1-1] user=[unknown],db=[unknown] LOG:
>> connection received: host=::1 port=47945
>> 2014-01-05 10:12:18 IST [17022]: [1-1] user=[unknown],db=[unknown] LOG:
>> connection received: host=::1 port=47946
>> 2014-01-05 10:12:18 IST [17022]: [2-1] user=postgres,db=postgres FATAL:
>> password authentication failed for user "postgres"
>> 2014-01-05 10:12:18 IST [17022]: [3-1] user=postgres,db=postgres
>> DETAIL: Connection matched pg_hba.conf line 90: "host
>> all all ::1/128 md5"
>>
>>
> Alright so it (psql I assume) makes the connection but is failing when the
> password is supplied. That would point to an erroneous password being
> supplied from the root shell. This would seem to mean there is a ~/.pgpass
> file with an incorrect value or a PGPASSWORD environment variable with an
> incorrect value. There is also the possibility that PGPASSFILE was set to
> point to a file other than .pgpass. To confirm that it is a password issue
> you could temporarily change the pg_hba.conf line above to trust and
> attempt the connection to see if it succeeds.
>
>
>> chroot, shell user postgres
>>
>> 2014-01-05 10:12:48 IST [17051]: [1-1] user=[unknown],db=[unknown] LOG:
>> connection received: host=::1 port=47948
>> 2014-01-05 10:12:51 IST [17052]: [1-1] user=[unknown],db=[unknown] LOG:
>> connection received: host=::1 port=47949
>> 2014-01-05 10:12:51 IST [17052]: [2-1] user=postgres,db=postgres LOG:
>> connection authorized: user=postgres database=postgres
>>
>>
>>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)gmail(dot)com
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-01-05 17:12:30 Re: authentication failure
Previous Message Adrian Klaver 2014-01-05 15:38:41 Re: file system level backup