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 1ix8d8-0003Ts-KC for pgsql-admin@arkaria.postgresql.org; Thu, 30 Jan 2020 12:09:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ix8d6-0003nJ-B3 for pgsql-admin@arkaria.postgresql.org; Thu, 30 Jan 2020 12:09:04 +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 1ix8d5-0003nC-Od for pgsql-admin@lists.postgresql.org; Thu, 30 Jan 2020 12:09:03 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ix8d1-00063f-DS for pgsql-admin@lists.postgresql.org; Thu, 30 Jan 2020 12:09:01 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id E6493BE0B74 for ; Thu, 30 Jan 2020 13:08:56 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at rs.plausibolo.de Received: from rs.plausibolo.de ([IPv6:::1]) by localhost (h2367442.stratoserver.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id jfvHKAirC1gT; Thu, 30 Jan 2020 13:08:53 +0100 (CET) Received: from [192.168.178.63] (ip-37-201-154-65.hsi13.unitymediagroup.de [37.201.154.65]) by rs.plausibolo.de (Postfix) with ESMTPSA id 5FE2DBE054E; Thu, 30 Jan 2020 13:08:53 +0100 (CET) To: pgsql-admin@lists.postgresql.org References: From: Holger Jakobs Autocrypt: addr=holger@jakobs.com; prefer-encrypt=mutual; keydata= xsDiBEG8IA8RBAC6WqUzEP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B+dPwF6jgKXHMvSUs6ExWPOyLZhpIQ9Ko9fDyQUrdrqgEhq5Nv+eVyufekVp6 Hsi/Zs4+a+sKA6jzUVyGyvOX6BlSDEa2/xLn4Ejj+R+lR8m7wTw+AqaRMOENH0bDAmjnL4m5 Ix6Kwk8EGBECAA8CGwwFAlZ7KnEFCSeLDWEACgkQileck7MZYbq7pwCfWr8oo3UZbO5elz3N nATMrN8bv7IAnjlSROg88AQUVHekuprX9nhuBT14 Subject: Re: setting up pg_ident for peer auth with unix groups Message-ID: Date: Thu, 30 Jan 2020 13:08:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------D3943236DB456DB60AD118F8" Content-Language: de-DE List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------D3943236DB456DB60AD118F8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Geoff, No, there is no such mechanism. The ident service (it's not safe as you probably know) only delivers the name of the user who has initiated the TCP connection to the PG server. This will be matched to the PG user the connection is supposed to be established as. If they match, the respective line of pg_hba.conf might grant access. pg_ident.conf can be used to match system usernames (of the client machine) to PG usernames. The /etc/group file which technically could be accessed by PG processes resides on the server and thus could be very different from the one on the client machine. Plus, the system username used on the client machine may not even exist on the server, nor does the PG username have to exist as a system username on client or server. Therefore, using Unix groups wouldn't make much sense. Regards, Holger Am 30.01.20 um 12:59 schrieb Geoff Winkless: > Hi > > Not sure if I'm missing something=C2=A0obvious=C2=A0but I can't see a w= ay to set > up pg_ident with unix groups in the username maps. > > https://www.postgresql.org/docs/12/auth-username-maps.html=C2=A0 > =C2=A0 > Is it possible or do I have to set up one entry for every user? > > Ta > > Geoff --=20 Holger Jakobs, Bergisch Gladbach instant messaging: xmpp:holger@jakobs.com +49 178 9759012 oder +49 2202 817157 --------------D3943236DB456DB60AD118F8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi Geoff,

No, there is no such mechanism. The ident service (it's not safe as you probably know) only delivers the name of the user who has initiated the TCP connection to the PG server.

This will be matched to the PG user the connection is supposed to be established as. If they match, the respective line of pg_hba.conf might grant access.

pg_ident.conf can be used to match system usernames (of the client machine) to PG usernames.

The /etc/group file which technically could be accessed by PG processes resides on the server and thus could be very different from the one on the client machine. Plus, the system username used on the client machine may not even exist on the server, nor does the PG username have to exist as a system username on client or server.

Therefore, using Unix groups wouldn't make much sense.

Regards,

Holger

Am 30.01.20 um 12:59 schrieb Geoff Winkless:
Hi

Not sure if I'm missing something obvious but I can't see a way to set up pg_ident with unix groups in the username maps.

 
Is it possible or do I have to set up one entry for every user?

Ta

Geoff
--

Holger Jakobs, Bergisch Gladbach
instant messaging: xmpp:holger@jakobs.com
+49 178 9759012 oder +49 2202 817157

--------------D3943236DB456DB60AD118F8--