pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Bryn Llewellyn <bryn@yugabyte.com>
To: pgsql-general list <pgsql-general@lists.postgresql.org>
Cc: Peter J. Holzer <hjp-pgsql@hjp.at>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Subject: Re: Putting the O/S user for "local" "peer" authentication in the "postgres" group vs chmod'ing the "pg*.conf" files to be readable by "all"
Date: Tue, 01 Nov 2022 07:48:52 +0100
Message-ID: <41ba7401df2baa95daed163f946976669a19913c.camel@cybertec.at> (raw)
In-Reply-To: <5EDD4790-7982-4610-8371-9E7F9C7F960B@yugabyte.com>
References: <5EDD4790-7982-4610-8371-9E7F9C7F960B@yugabyte.com>

On Mon, 2022-10-31 at 22:03 -0700, Bryn Llewellyn wrote:
> I followed Peter's recommendation NOT to put my "clstr_mgr" O/S user in the "postgres"
> group—having earlier had it there. But doing so brought this content-free error message
> on an attempt to authorize using the intended method:
> 
> Error: Invalid data directory for cluster 11 main

That*s a message from the *server*, which always runs under the same OS user.

> A bit of Googling got me to this on the pgsql-general list (from the Peter, in fact):
> 
> https://www.postgresql.org/message-id/20190909171519.GA7858%40hjp.at
> 
> on that very topic.
> 
> It seems that the error message is simply misleading and that it should read "Cannot read
> the config_file, hba_file, or ident_file" — as they are named in this query's output":
> 
> select name, setting
> from pg_settings
> where category = 'File Locations';
> 
> Sure enough, neither my hba_file nor my ident_file were readable by "all" (but they were
> readable by "group"). However, the config_file was readable by "all". I've no idea what
> the history of those permissions is. Maybe I changed something along the way. I s'pose
> that I'd better regard my present installation as a dress rehearsal and simply redo it
> starting by restoring my "bare" Linux VM from file backup.
> 
> Anyway, just to prove the point, I chmod'd my hba_file and my ident_file to make them
> readable by all. And the silly error message went away.
> 
> However, that feels wrong to me. It would seem proper to put any user who you want to
> set up for "local", "peer" authentication into the "postgres" group.
> 
> What do you (all) think?

I think that you are doing something very weird, but I have no idea what it is.
Please tell us the exact commands you ran.

The client user should *never* read the PostgreSQL configuration files, so if changing
the permissions (which you should *never* do) has an effect, you must be doing something
very strange, like trying to start the database server with the wrong user.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





view thread (18+ messages)  latest in thread

Message-ID: <41ba7401df2baa95daed163f946976669a19913c.camel@cybertec.at>
Permalink:  ../41ba7401df2baa95daed163f946976669a19913c.camel@cybertec.at/
Also on:    postgresql.org/message-id/41ba7401df2baa95daed163f946976669a19913c.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, bryn@yugabyte.com, hjp-pgsql@hjp.at, david.g.johnston@gmail.com, adrian.klaver@aklaver.com
  Subject: Re: Putting the O/S user for "local" "peer" authentication in the "postgres" group vs chmod'ing the "pg*.conf" files to be readable by "all"
  In-Reply-To: <41ba7401df2baa95daed163f946976669a19913c.camel@cybertec.at>
  References: <5EDD4790-7982-4610-8371-9E7F9C7F960B@yugabyte.com> <41ba7401df2baa95daed163f946976669a19913c.camel@cybertec.at>

* 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