Re: Can we stop defaulting to 'ident'?

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Devrim Gündüz <devrim(at)gunduz(dot)org>
Cc: pgsql-pkg-yum <pgsql-pkg-yum(at)postgresql(dot)org>
Subject: Re: Can we stop defaulting to 'ident'?
Date: 2019-12-23 06:04:25
Message-ID: CAMsr+YFBeZ+jUs0q1h9LO=OcYDstEN7b=4NyOiiS33yH2CaWqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-debian pgsql-pkg-yum

On Fri, 20 Dec 2019 at 15:45, Devrim Gündüz <devrim(at)gunduz(dot)org> wrote:

> Hi,
>
> On Thu, 2019-12-19 at 12:58 +0800, Craig Ringer wrote:
>
> > It's not clear why the initdb wrapper for the rpm packages defaults to
> > generating 'host' entries with 'ident' auth,
>
> Historical reasons, like at least 15 years or more.
>

Time to revisit it then.

The current default is already broken. It is more broken than, and less
useful than, defaulting to 'md5' for 'host' since at least then users could
make it work by setting a password.

ident requires entirely new and different daemons to be installed,
configured and enabled.

> > but I think it's pretty unhelpful. At least if we used 'md5' the user
> could
> > set passwords and have them actually work.
>
> IMHO the only alternative could be "trust", because I am not holding my
> breath
> for the majority of our users to be able to setup a password that easily
> (yeah). I'm also not inclined to setup a default password for RPM
> installations
> (and also RPMs must not do any interactive work, like asking for a
> password)

The deb use md5 for 'host' and 'peer' for 'local'. While I think they do
support interactive password setting it's extremely common to run debconf
noninteractively, then set an initial password using psql with the peer
auth conn over a unix socket.

That's the approach I suggest for the rpms too. A stanza to the setup shell
script can even be added to give a hint for next steps:

echo PostgreSQL instance created at /var/lib/pgsql/12/data and set to
listen on port $NEWPGPORT.
echo
echo Start it with systemctl start postgresql-12 .

if [ $local_authmode == 'peer' ]; then
echo Connect with 'sudo -u postgres psql -p $NEWPGPORT' to create
users, set passwords and create databases.
fi

or something like that.

--
Craig Ringer http://www.2ndQuadrant.com/
2ndQuadrant - PostgreSQL Solutions for the Enterprise

In response to

Responses

Browse pgsql-pkg-debian by date

  From Date Subject
Next Message Craig Ringer 2019-12-23 06:06:18 Re: Can we stop defaulting to 'ident'?
Previous Message apt.postgresql.org Repository Update 2019-12-20 16:30:51 pgadmin4 updated to version 4.16-1.pgdg+1

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Craig Ringer 2019-12-23 06:06:18 Re: Can we stop defaulting to 'ident'?
Previous Message Stephen Frost 2019-12-20 15:21:01 Re: Can we stop defaulting to 'ident'?