From owner-freebsd-questions Mon Nov 1 8:30: 6 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 0A9FE14BFA for ; Mon, 1 Nov 1999 08:30:02 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id KAA96734; Mon, 1 Nov 1999 10:29:41 -0600 (CST) (envelope-from dan) Date: Mon, 1 Nov 1999 10:29:41 -0600 From: Dan Nelson To: Christian Kratzer Cc: TrouBle , "freebsd-questions@freebsd.org" Subject: Re: REWARD...! Perl Programmer master.passwd problem Message-ID: <19991101102941.A96221@dan.emsphone.com> References: <381CD49F.7243D959@hackfurby.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from ck@toplink.net on Mon, Nov 01, 1999 at 10:18:16AM +0100 X-OS: FreeBSD 4.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Nov 01), Christian Kratzer said: > no big deal. We have awk or perl scripts creating master.passwd files > on freebsd since we started with FreeBSD 2.0. We learned by reading > the vipw source code. > > You need to do following > > 1. write master.passwd.tmp or other name somewhere in same file > system as /etc lives in. Best is /etc/master.passwd.tmp > > 2. run pwd_mkdb -p /etc/master.passwd.tmp > > This installs the new master.passwd and creates/updates following files > - passwd plaintext stripped version of master.passwd in classic > unix format without crypted passwords > - spwd.db Binary version of master.passwd > - pwd.db Binary version of passwd > > All the information for the other files is in master.passwd > > Thats it. But beware. You can screw up things really bad. And that 'Beware' line is exactly the reason you should be using the 'pw' command :) Pw is supposed to be called from interactive programs to actually do the modifications; it handles everything for you. If you are only changing/adding one userid, it won't rebuild the entire .db file, making updates a lot faster. -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message