X-Original-To: pgsql-advocacy@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 3282D925115 for ; Wed, 21 May 2003 02:38:12 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 04056-09 for ; Wed, 21 May 2003 02:37:40 -0400 (EDT) Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) by developer.postgresql.org (Postfix) with ESMTP id 07A1C925132 for ; Wed, 21 May 2003 02:37:38 -0400 (EDT) Received: (from root@localhost) by www.pspl.co.in (8.11.6/8.11.6) id h4L6ban02914 for ; Wed, 21 May 2003 12:07:36 +0530 Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h4L6bXA02888; Wed, 21 May 2003 12:07:34 +0530 From: "Shridhar Daithankar" To: pgsql-general@postgresql.org, ahoward Date: Wed, 21 May 2003 12:06:36 +0530 MIME-Version: 1.0 Subject: Re: [GENERAL] pam-linux, /etc/shadow : HOW-TO Reply-To: shridhar_daithankar@persistent.co.in Cc: pgsql-advocacy@postgresql.org Message-ID: <3ECB6BCC.12574.4EAEA68@localhost> In-reply-to: X-mailer: Pegasus Mail for Windows (v4.11) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/59 X-Sequence-Number: 1178 Hi, could you please make a smal writeup on this so that it canbe posted on techdocs. A small HOWTO.. That would help a lot of people. Shridhar On 20 May 2003 at 19:13, ahoward wrote: > > note: i'm no sysad, nor do i even pretend to understand pam, the linux kernel, > or postgresql, but this setup is a safe, working, postgresql/linux/pam setup. > > 0) configure postgresql for pam, for example > > [root@omega tmp]# grep pam /usr/local/pgsql/data/pg_hba.conf > host all all 137.75.0.0 255.255.0.0 pam > > 1) create a /etc/pam.d/postgresql entry, here's how i did mine > > [root@omega tmp]# cp /etc/pam.d/passwd /etc/pam.d/postgresql > > i don't know if it's the best setup, but it works! mine looks like this > > [root@omega tmp]# cat /etc/pam.d/postgresql > #%PAM-1.0 > auth required /lib/security/pam_stack.so service=system-auth > account required /lib/security/pam_stack.so service=system-auth > password required /lib/security/pam_stack.so service=system-auth > > 2) create a shadow group which will be used for user's needing read-access to > /etc/shadow, and add postgres (or whatever user the postmaster runs as) to > this entry. i used vi to add this entry to /etc/group > > [root@omega tmp]# grep shadow /etc/group > shadow:*:4002:root,postgres > > root probably does not *need* to be added. > > note the '*' v.s. an 'x' in the password field. if you place an 'x' there > you will also have to set up /etc/gshadow - i did not want to do this. if > you don't set up /etc/gshadow pam will NOT work if an 'x' is in the password > field - at least with my linux system. > > 3) make /etc/shadow group shadow > > [root@omega tmp]# chgrp shadow /etc/shadow > > 4) chmod 0440 /etc/shadow > > > essentially, pam will not work with postgres since the daemon needs at some > point, no matter how many library calls deep, to open and read /etc/shadow > (assuming this is how your system is using pam). you must have some solution > which allows postgres, but not everyone, to read /etc/shadow. others probably > exist. > > -a > > -- > ==================================== > | Ara Howard > | NOAA Forecast Systems Laboratory > | Information and Technology Services > | Data Systems Group > | R/FST 325 Broadway > | Boulder, CO 80305-3328 > | Email: ara.t.howard@fsl.noaa.gov > | Phone: 303-497-7238 > | Fax: 303-497-7259 > ==================================== > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster