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 1ixCU9-0002KD-R4 for pgsql-admin@arkaria.postgresql.org; Thu, 30 Jan 2020 16:16:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ixCU7-0004P1-Jn for pgsql-admin@arkaria.postgresql.org; Thu, 30 Jan 2020 16:16:03 +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 1ixCU7-0004Ou-7R for pgsql-admin@lists.postgresql.org; Thu, 30 Jan 2020 16:16:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ixCU3-0007zT-9A for pgsql-admin@lists.postgresql.org; Thu, 30 Jan 2020 16:16:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 00UGFmmW021562; Thu, 30 Jan 2020 11:15:48 -0500 From: Tom Lane To: Geoff Winkless cc: pgsql-admin@lists.postgresql.org Subject: Re: setting up pg_ident for peer auth with unix groups In-reply-to: References: Comments: In-reply-to Geoff Winkless message dated "Thu, 30 Jan 2020 11:59:45 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21560.1580400948.1@sss.pgh.pa.us> Date: Thu, 30 Jan 2020 11:15:48 -0500 Message-ID: <21561.1580400948@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Geoff Winkless writes: > 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. > https://www.postgresql.org/docs/12/auth-username-maps.html > Is it possible or do I have to set up one entry for every user? If your goal is "allow any local user who is a member of group X to connect", you might be able to do it by setting restrictive filesystem privileges on the postmaster's Unix-socket file. This has some disadvantages --- notably, there's no way to override and let selected non-group-members in too --- but it's worth considering. See the unix_socket_group and unix_socket_permissions GUCs. regards, tom lane