pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: shing dong <s7eqs7eq@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to confirm the pg_hba.conf service is correctly working
Date: Tue, 21 Dec 2021 09:42:46 -0500
Message-ID: <2754440.1640097766@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEJor113xtxBOECGu4cyGLrn0vf1qgAw6tAfx9LJSaMdWY-qRA@mail.gmail.com>
References: <CAEJor113xtxBOECGu4cyGLrn0vf1qgAw6tAfx9LJSaMdWY-qRA@mail.gmail.com>

shing dong <s7eqs7eq@gmail.com> writes:
> 1. The rules in pg_hba.conf are almost invalid
> 2. pg_hba.conf is only useful for METHOD = trust
> 3. check SHOW hba_file; the file location is correct
> 4. select * from pg_hba_file_rules;  checked  is correct
> 5.DB version :  PostgreSQL 10.19  on x86_64-pc-linux-gnu, compiled by gcc
> (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
> Even if you delete the text in pg_hba.conf
> Keep only
> host   VJ   VJ_USER   10.10.10.1/32 md5
> After  pg_ctl reload and  Restart DB , any ip, user still can log in to DB

It's hard to say where your mistake is, but probably the first
thing to check is whether you're really restarting the postmaster.
I'm wondering in particular if there's more than one PG instance
on the machine and you're reconfiguring or restarting the wrong
one.  Other than that, retrace your steps carefully, because at
least one of the above statements must be wrong.

(I guess if you were feeling *really* paranoid, you could wonder
whether somebody replaced your postmaster executable with a hacked
version that doesn't apply any pg_hba checks.  But pilot error
seems like a far more probable explanation.)

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <2754440.1640097766@sss.pgh.pa.us>
Permalink:  ../2754440.1640097766@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2754440.1640097766@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, s7eqs7eq@gmail.com
  Subject: Re: How to confirm the pg_hba.conf service is correctly working
  In-Reply-To: <2754440.1640097766@sss.pgh.pa.us>
  References: <CAEJor113xtxBOECGu4cyGLrn0vf1qgAw6tAfx9LJSaMdWY-qRA@mail.gmail.com> <2754440.1640097766@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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