Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Apr 1996 13:50:46 -0600 (MDT)
From:      Dave Andersen <angio@aros.net>
To:        ernie@spooky.apana.org.au (Ernie Elu)
Cc:        questions@freebsd.org
Subject:   Re: Converting Linux password files to FreeBSD master.passwd
Message-ID:  <199604161950.NAA19540@shell.aros.net>
In-Reply-To: <199604161258.WAA00375@spooky.apana.org.au> from Ernie Elu at "Apr 16, 96 10:58:29 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Lo and behold, Ernie Elu once said:

> Is there a method if you don't run linux shadow passwords?
> 
> I have about 450 users to convert, thats why I am still running linux on
> most machines.
> 

  Ack!  i realized that in my last message, I just sent pwunconv.  The 
way I do it is to first pwunconv and then to run it through this script, 
which does exactly what you're asking for:

-- 
angio@aros.net                Complete virtual hosting and business-oriented
system administration         Internet services.  (WWW, FTP, email)
http://www.aros.net/          http://www.aros.net/about/virtual
  "There are only two industries that refer to thier customers as 'users'."

$passwd_file = "linux-passwd";
$outfile = "bsd-master.passwd";

open(PASSWD, "$passwd_file") || die "Could not open passwd file: $!\n";
open(OUT, ">$outfile") || die "Could not open output: $!\n";

while (<PASSWD>) {
        $count++;
        chop;
        ($uname, $passwd, $uid, $gid, $name, $homedir, $shell) = split(/:/);

        printf(OUT "%s:%s:%d:%d::0:0:%s:%s:%s\n",
                $uname, $passwd, $uid, $gid, $name, $homedir, $shell);
}




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604161950.NAA19540>