Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijGqg-00069V-Bs for pgsql-pkg-yum@arkaria.postgresql.org; Mon, 23 Dec 2019 06:05:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ijGpg-0000P1-M1 for pgsql-pkg-yum@arkaria.postgresql.org; Mon, 23 Dec 2019 06:04:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijGpg-0000Ou-7i for pgsql-pkg-yum@lists.postgresql.org; Mon, 23 Dec 2019 06:04:44 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ijGpc-00065X-IO for pgsql-pkg-yum@postgresql.org; Mon, 23 Dec 2019 06:04:42 +0000 Received: by mail-lj1-x242.google.com with SMTP id r19so16587169ljg.3 for ; Sun, 22 Dec 2019 22:04:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KvjW3YfxxfRtMuPY6M0rjRS8Y0F6k6xX6TDZGy/I4ps=; b=kArOUgO3eB8ESEDO3NlbPeS6t7NpKy9Ib8LWjZt0BpsL0NrjM6iNDJ2dr3WQLtnGXA FFBRt+sgZ8JRSiQtpusPPKvZS4+Xs5wt0I8YTIjq54kkLJhQJN7Tb4wD8cYFeboiKNln SWp9ec1fs06RZWlrXcPaZ4MDIJ9FH7MnvlKVgcKN9vMLloHUpFiWg7pLmZTXgLxIrSqQ 5BDuQcH1rebLPysYmefb22b/Ehi3HsFThA/HE9236zaKWeJzuDmT1wwbokOxTjb4SE66 TcFK6z6Id8pK2zwBzkMwFwtZ9GzCsRz5CiZItgfs/Ylg0gB+8Ityim704F/RhvDzkZvE hvpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KvjW3YfxxfRtMuPY6M0rjRS8Y0F6k6xX6TDZGy/I4ps=; b=ZV/npdfn6g/3Ni7yKD4B+0tuUl91CwFrrutSJnCxTDD+bMDXI8Q3WH3UV6GUjDr3Cf 1fzwqnGPgplYFpPkUpkS+Lf6zosTHV5EayNuPrcZU7LdGRm/Bdp4t+09qbhna2dGCw72 J485qZB22qiySGrjqOvZ25GBifxOEwynDv/yPmprR/UpxQdMJpsyhE/ggLPVMBWpBPJU U7F7qMNBTc3tRtdm1JcIaXGV0t9XtdvQap6B5B3N9WMncnnIrY+tpA9LomfrRX6XF40F 6q/8Dld5hilB9Ks3qlRUYL++/WuwYly68oMm/X+0HwbKQ6TpCo+oVBchHn7XojEd+tGj NTOw== X-Gm-Message-State: APjAAAWKkemiTtqH6izJFVr7EhKAh05ONboPf8G4p7/bMJYYmgfIn0+O gH2TayjyoMISmkwTKchK+ZG8UyYywKU31Qa0XvxhXi0ZRg8= X-Google-Smtp-Source: APXvYqzSlaAIGgqkDThKcbtL8zACdwmt2W2/NV4bJVRyxsXuZoQiRHG0xekxK+pRODTtCTAffK14upSQMwEcBVcR7DA= X-Received: by 2002:a2e:8699:: with SMTP id l25mr17411060lji.159.1577081078283; Sun, 22 Dec 2019 22:04:38 -0800 (PST) MIME-Version: 1.0 References: <77df509da61adaebca6c5f0451f1c1616f1faa45.camel@gunduz.org> In-Reply-To: <77df509da61adaebca6c5f0451f1c1616f1faa45.camel@gunduz.org> From: Craig Ringer Date: Mon, 23 Dec 2019 14:04:25 +0800 Message-ID: Subject: Re: Can we stop defaulting to 'ident'? To: =?UTF-8?B?RGV2cmltIEfDvG5kw7x6?= Cc: pgsql-pkg-yum Content-Type: multipart/alternative; boundary="00000000000074177c059a58cd0c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000074177c059a58cd0c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 20 Dec 2019 at 15:45, Devrim G=C3=BCnd=C3=BCz w= rote: > 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 =3D=3D 'peer' ]; then echo Connect with 'sudo -u postgres psql -p $NEWPGPORT' to create users, set passwords and create databases. fi or something like that. --=20 Craig Ringer http://www.2ndQuadrant.com/ 2ndQuadrant - PostgreSQL Solutions for the Enterprise --00000000000074177c059a58cd0c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, 20 Dec 2019 at 15:45, Devrim G=C3= =BCnd=C3=BCz <devrim@gunduz.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 default= s to
> generating 'host' entries with 'ident' auth,

Historical reasons, like at least 15 years or more.
= =C2=A0
Time to revisit it then.

The curr= ent 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.=C2=A0

id= ent requires entirely new and different daemons to be installed, configured= and enabled.
=C2=A0
> but I think it's pretty unhelpful. At least if we used 'md5= 9; the user could
> set passwords and have them actually work.

IMHO the only alternative could be "trust", because I am not hold= ing 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 insta= llations
(and also RPMs must not do any interactive work, like asking for a password= )

The deb use md5 for 'host' and &#= 39;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 un= ix socket.

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

=C2=A0 =C2=A0 echo PostgreSQ= L instance created at /var/lib/pgsql/12/data and set to listen on port $NEW= PGPORT.
=C2=A0 =C2=A0 echo=C2=A0
=C2=A0 =C2=A0 echo Sta= rt it with systemctl start postgresql-12 .

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

or something like that= .

--
=C2=A0Craig Ringe= r=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 http://www.2ndQuadrant.com/
=C2=A02ndQuadrant - = PostgreSQL Solutions for the Enterprise
--00000000000074177c059a58cd0c--