pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_hba.conf settings for postgres
3+ messages / 3 participants
[nested] [flat]

* pg_hba.conf settings for postgres
@ 2024-02-17 20:33  Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Teju Jakkidi vlogs @ 2024-02-17 20:33 UTC (permalink / raw)
  To: pgsql-admin <pgsql-admin@lists.postgresql.org>

Hello Admins,

I have below settings in my pg_hba.conf file:


local   all             postgres                                trust
local   all             all                                     md5
host    all             all             127.0.0.1/32            trust
host    all             all             0.0.0.0/0               md5
host    all             all             ::1/128                 trust
host    all             all             ::/0                    md5

Our expectation is that - when logging as postgres user from local host,
it should not prompt for the password as we have local for postgres set to
trust and loopback is set to trust.
However, when running psql as postgres user from the local host, it is
still asking for the password.

Adding below lines in  pg_hba.conf file is working as expected:

host     all           postgres       Local IP/32            trust

Adding an entry for local host IP and making it trust for postgres user is
working as expected and not prompting for password. However, removing this
line is prompting for the postgres password from the local host.

Not sure why there needs to be an entry for IP even when we already have
local for postgres and loopback set to trust.

Any inputs here will be of great help!!

Thanks,
Teja.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_hba.conf settings for postgres
@ 2024-02-17 20:40  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2024-02-17 20:40 UTC (permalink / raw)
  To: Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>; +Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>

Teju Jakkidi vlogs <teja.jakkidi05@gmail.com> writes:
> Our expectation is that - when logging as postgres user from local host,
> it should not prompt for the password as we have local for postgres set to
> trust and loopback is set to trust.
> However, when running psql as postgres user from the local host, it is
> still asking for the password.

> Adding below lines in  pg_hba.conf file is working as expected:
> host     all           postgres       Local IP/32            trust

So psql is connecting to the "local IP", not to the loopback address.
This is probably a matter of DNS configuration, but since you didn't
show us the exact command, it's hard to say more than that.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_hba.conf settings for postgres
@ 2024-02-18 02:17  andrew burns <70camero@live.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: andrew burns @ 2024-02-18 02:17 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>; +Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>

Try to change it to tru an not trust reason being I it works semantics rather than true or false or should be try true not trust see i bot for that network remind the Tex is that.

Get Outlook for Android<https://aka.ms/AAb9ysg;
________________________________
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Saturday, February 17, 2024 12:40:21 PM
To: Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>
Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: pg_hba.conf settings for postgres

Teju Jakkidi vlogs <teja.jakkidi05@gmail.com> writes:
> Our expectation is that - when logging as postgres user from local host,
> it should not prompt for the password as we have local for postgres set to
> trust and loopback is set to trust.
> However, when running psql as postgres user from the local host, it is
> still asking for the password.

> Adding below lines in  pg_hba.conf file is working as expected:
> host     all           postgres       Local IP/32            trust

So psql is connecting to the "local IP", not to the loopback address.
This is probably a matter of DNS configuration, but since you didn't
show us the exact command, it's hard to say more than that.

                        regards, tom lane

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-02-18 02:17 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-02-17 20:33 pg_hba.conf settings for postgres Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>
2024-02-17 20:40 ` Tom Lane <tgl@sss.pgh.pa.us>
2024-02-18 02:17   ` andrew burns <70camero@live.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox