Return to BSD News archive
Newsgroups: comp.unix.bsd.freebsd.misc Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!classic.iinet.com.au!swing.iinet.net.au!news.uoregon.edu!vixen.cso.uiuc.edu!uwm.edu!lll-winken.llnl.gov!fnnews.fnal.gov!unixhub!news.Stanford.EDU!microunity!usenet From: deborah@gallifrey.microunity.com (Deborah Gronke Bennett) Subject: Re: Converting Old Passwd file to New? In-Reply-To: dhawk@netcom.com's message of Mon, 23 Oct 1995 21:26:29 GMT Message-ID: <DEBORAH.95Oct30164140@gallifrey.microunity.com> Sender: usenet@microunity.com (news id) Organization: MicroUnity Systems Engineering, Inc. References: <dhawkDGx7K5.5Bq@netcom.com> Date: Tue, 31 Oct 1995 00:41:40 GMT Lines: 49 In article <dhawkDGx7K5.5Bq@netcom.com> dhawk@netcom.com (David H) writes: > > I've set up a new FreeBSD machine and need to move a group of > people over to it. The passwd file on the old machine (linux) > is old-style of > <userid>:<enc_passwd>:<userno>:<grp_no:>: [and so forth] > > How to I convert that to FreeBSD since I don't know anyone's password > (except mine)? I have exactly this same problem - I have 5 FreeBSD machines on a network where /etc/passwd is rdist'd every night from a sun network. Here's what you have to do: - at install time, you must install the DES software. I hope you're inside the US. You must get the install package from the ftp site - it is not on the install CD. - After installation, process the existing passwd file using a simple awk script like this one: BEGIN { FS = ":"} { print $1 ":" $2 ":" $3 ":" $4 "::0:0:" $5 ":" $6 ":" $7 } Redirect the output of the awk to something like "master.passwd.new" Now run pwd_mkdb on that file. This will rebuild the passwd database. If you run pwd_mkdb with the -p option, it will also generate an /etc/passwd file which looks like the ones on your other machines. You should now have passwords for everyone. Since mucking with passwd files this way is error-intolerant, be sure to make a copy of /etc/master.passwd before you start. If after you run pwd_mkdb you can't go to one of the other virtual consoles and log in, you've messed something up. Quick, run pwd_mkdb on the old /etc/master.passwd so you at least get your post-installation root login back so you have permissions to fix the problem. Whatever you do, don't log off as root until you know you can log back on again. (She says from recent experience) Good luck! -- ---------- Deborah Gronke Bennett (WD5HJH) kernel and device drivers engineer deborah@microunity.com (408)-734-8100 MicroUnity Systems Eng., 255 Caspian Drive, Sunnyvale, CA 94089-1015 USA I'm still looking to buy source code for the cscope program or the C programmer's toolchest containing it. UNIX is a trademark of whoever bought it this week . . .