Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jul 1996 07:21:32 -0400 (EDT)
From:      Weldon S Godfrey 3 <weldon@excelsus.com>
To:        questions@freebsd.org
Cc:        Gianmarco Giovannelli <gmarco@masternet.it>
Subject:   SUMMARY: Linux passwd -> FBSD passwd utility (fwd)
Message-ID:  <Pine.BSF.3.91.960708071310.911A-100000@ampere>

next in thread | raw e-mail | index | archive | help

Thanks for the info, the conversion went very well with the FBSD 2.2S 
running DES encryption.  I used Brandon's perl script to move the 
passwords in.


Weldon


Here's the script:

---------- Forwarded message ----------
Date: Fri, 28 Jun 1996 09:45:50 -0600 (MDT)
From: Brandon Gillespie <brandon@tombstone.sunrem.com>
To: Weldon S Godfrey 3 <weldon@excelsus.com>
Cc: questions@freebsd.org
Subject: Re: Linux passwd -> FBSD passwd utility

On Fri, 28 Jun 1996, Weldon S Godfrey 3 wrote:
> I would like to setup a FBSD box to replace an Linux system, but there is 
> the issue of porting the passwords over.  Does anyone have, or know where 
> to get, an utility/method to import linux passwords into a FreeBSD box?
> 
> Weldon

I dont know about a linux system with shadow passwords, but this will 
work elsewhere (assuming they are using the same password encryption 
scheme

----cut here----
#!/usr/bin/perl

##
## syntax: frobpwd < linux.passwd > freebsd.passwd
##
## No guarantees about the suitability or functionality of this script,
## I just hacked it up from memory of one I have used before
##

while (<STDIN>) {
    chomp;
    ($name, $pwd, $uid, $gid, $gcos, $home, $shell) = split(/:/);
    print "$name:$pwd:$uid:$gid::0:0:$gcos:$home:$shell";
}

----
WG Note:  I removed the last \n, it added an extra space to the file, the 
EOLN character is carried in with $shell. 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960708071310.911A-100000>