RE: md5 and trust and pg_hba.conf

From: David Raymond <David(dot)Raymond(at)tomtom(dot)com>
To: "'pgsql-sql(at)lists(dot)postgresql(dot)org'" <pgsql-sql(at)lists(dot)postgresql(dot)org>, "'pgsql-novice(at)lists(dot)postgresql(dot)org'" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: RE: md5 and trust and pg_hba.conf
Date: 2018-09-10 15:41:03
Message-ID: VI1PR07MB07842B80F65E76B9945EC36987050@VI1PR07MB0784.eurprd07.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

It goes through pg_hba.conf <in order>. So do you have other lines above these lines that would match a local connection, but have md5, or one of the other authentication methods set?

Since you mentioned gd07 has a pgpass file then I don't think it's a case of the pg_hba line being right for gd07 and wrong for psgdba, I think they're both "wrong" in that a previous line is being used which prompts for a password, and since gd07 has a password stored, then it uses that and winds up connected ok in the end.

From: Rossi, Maria [mailto:maria(dot)rossi(at)jackson(dot)com]
Sent: Monday, September 10, 2018 10:46 AM
To: 'pgsql-sql(at)lists(dot)postgresql(dot)org'; 'pgsql-novice(at)lists(dot)postgresql(dot)org'
Subject: md5 and trust and pg_hba.conf

Hi,

Question on pg_hba.conf.  I have these entries:

host    all             psgdba           localhost           trust
host    all             psgdba           127.0.0.1/32            trust
host    all             gd07           localhost                trust
host    all             gd07            127.0.0.1/32           trust

Command to logon to Postgres:
/usr/pgsql-9.3/bin/psql -d postgres

If I am logged on ‘gd07’  at the server , it lets me log-on to Postgres without prompting for password
If I am logged on as ‘psgdba’, it prompts for password.
As you can see, both have ‘trust’, but ‘gd07’ is the instance owner.

Why does ‘psgdba’ prompts?  What I am missing?
Your help would be much appreciated.

Thanks.
Maria

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Rossi, Maria 2018-09-10 19:47:04 RE: md5 and trust and pg_hba.conf
Previous Message Sameer Kumar 2018-09-10 15:35:14 Re: md5 and trust and pg_hba.conf

Browse pgsql-sql by date

  From Date Subject
Next Message Rossi, Maria 2018-09-10 19:47:04 RE: md5 and trust and pg_hba.conf
Previous Message Sameer Kumar 2018-09-10 15:35:14 Re: md5 and trust and pg_hba.conf