From owner-freebsd-isp Mon Nov 11 15:30:36 1996 Return-Path: owner-isp Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA20099 for isp-outgoing; Mon, 11 Nov 1996 15:30:36 -0800 (PST) Received: from mailhub.aros.net (mailhub.aros.net [205.164.111.17]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id PAA20012 for ; Mon, 11 Nov 1996 15:29:51 -0800 (PST) Received: from fluffy.aros.net (fluffy.aros.net [205.164.111.2]) by mailhub.aros.net (8.7.6/Unknown) with ESMTP id QAA09197; Mon, 11 Nov 1996 16:29:50 -0700 (MST) Received: from fluffy.aros.net (localhost [127.0.0.1]) by fluffy.aros.net (8.7.6/8.6.12) with ESMTP id QAA01390; Mon, 11 Nov 1996 16:29:47 -0700 (MST) Message-Id: <199611112329.QAA01390@fluffy.aros.net> To: Michael Slater cc: freebsd-isp@freebsd.org Subject: Re: Converting linux shadow passwords In-reply-to: Your message of "Mon, 11 Nov 1996 09:56:09 +0800." Date: Mon, 11 Nov 1996 16:29:46 -0700 From: Dave Andersen Sender: owner-isp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I am in the process of switching from Linux to FreeBSD, and am > wondering if their is a method of Converting the Linux password/shadow > file into a FreeBSD password file, other than manually re-entering every > user ? You have to be set up using DES passwords on your FreeBSD system. There's a FAQ entry that tells you how to do this, I believe. Once you've done that, use a script like this, which will print out the freebsd-style master.passwd file. Don't forget to run pwd_mkdb afterwords. #!/bin/perl # Copyright 1996 David G. Andersen. All rights reserved. No warranty # is expressed or implied for the fitness of this program for any purpose. $shadow = "/etc/shadow"; $passwd = "/etc/passwd"; $output = "npasswd"; umask 077; open(SHADOW, $shadow) || die "Could not open shadow file\n"; while () { ($name, $enc) = split(/:/); $PASS{$name} = $enc; } close(SHADOW); open(PASSWD, $passwd) || die "Could not open passwd file\n"; open(OUT, ">$output") || die "Could not open output file\n"; while () { chop; ($uname, $blah, $uid, $gid, $gecos, $homedir, $shell) = split(/:/); printf(OUT "%s:%s:%d:%d::0:0:%s:%s:%s\n", $uname, $PASS{$uname}, $uid, $gid, $gecos, $homedir, $shell); }