From: | Fabio Pardi <f(dot)pardi(at)portavita(dot)eu> |
---|---|
To: | pgsql-novice(at)lists(dot)postgresql(dot)org |
Subject: | Re: md5 and trust and pg_hba.conf |
Date: | 2018-09-10 15:17:47 |
Message-ID: | 23dc6d79-466e-8133-d96f-84b2d10831fb@portavita.eu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice pgsql-sql |
Maria,
I share the thoughts of Samir.
Also, please note that localhost and 127.0.0.1 are the same. I would leave 'localhost' which also covers ipv6. And remove 127.0.0.1. Or the other way around if you do not use ipv6.
Aas per your problem can you copy/paste the 'prompt' you get when you try to connect as gd07?
Unless your pg_hba.conf contains more entries than here reported, you should get instead a:
psql: FATAL: no pg_hba.conf entry for host "a.b.c.d", user "some_user", database "some_db"
So please post the entire content of it as mentioned.
Also, it might help debugging if as psgdba you run:
env | grep PG
to check the PG variables set for the user.
What happens if you run as psgdba the following?
/usr/pgsql-9.3/bin/psql -d postgres -h localhost -U psgdba
Side note: when you have everything in order, please consider to enforce authentication on your db, thus removing 'trust'. 'Trust' is your enemy. Mkey?
Regards,
fabio pardi
On 10/09/18 16:55, Sameer Kumar wrote:
>
>
> On Mon, Sep 10, 2018 at 10:46 PM Rossi, Maria <maria(dot)rossi(at)jackson(dot)com <mailto:maria(dot)rossi(at)jackson(dot)com>> wrote:
>
> Hi,
>
>
>
> Question on pg_hba.conf. I have these entries:
>
>
>
> host all psgdba localhost trust
>
> host all psgdba 127.0.0.1/32 <http://127.0.0.1/32> trust
>
> host all gd07 localhost trust
>
> host all gd07 127.0.0.1/32 <http://127.0.0.1/32> trust
>
>
>
>
> Can you post the whole of pg_hba.conf file?
>
> You might have some other entry that is taking precedence.
>
>
>
>
> Command to logon to Postgres:
>
> /usr/pgsql-9.3/bin/psql -d postgres
>
>
> If you don't have PGHOST set then most likely you are not going over a tcp connection (which is what host entries in pg_hba are used for). Instead the local entries of pg_hba are taking effect.
>
>
>
> If I am logged on ‘gd07’ at the server , it lets me log-on to Postgres without prompting for password
>
>
> do you have a *.pgpass* file in the home directory?
>
>
> 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
>
>
>
> --
>
> --
>
> Best Regards,
>
> *Sameer Kumar | Senior Solution Architect*
>
> *ASHNIK PTE. LTD.*
>
> 36 Robinson Road, #14-04 City House, Singapore 068877
>
> T: +65 6438 3504 | www.ashnik.com <http://www.ashnik.com/>
>
> Skype: sameer.ashnik | M: +65 8110 0350
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Rossi, Maria | 2018-09-10 15:22:43 | RE: md5 and trust and pg_hba.conf |
Previous Message | Sameer Kumar | 2018-09-10 14:55:26 | Re: md5 and trust and pg_hba.conf |
From | Date | Subject | |
---|---|---|---|
Next Message | Rossi, Maria | 2018-09-10 15:22:43 | RE: md5 and trust and pg_hba.conf |
Previous Message | Sameer Kumar | 2018-09-10 14:55:26 | Re: md5 and trust and pg_hba.conf |