Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 1999 14:58:34 -0400
From:      "Jason J. Horton" <jason@intercom.com>
To:        Deepwell Internet <freebsd@deepwell.com>
Cc:        freebsd-isp@freebsd.org
Subject:   Re: changing server platforms
Message-ID:  <37F2615A.1EE6FCB6@intercom.com>
References:  <199909291601.JAA30532@pau-amma.whistle.com> <4.2.0.58.19990929113340.00c9ea60@mail1.dcomm.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------C3169BDEB4C04A12B675F269
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Deepwell Internet wrote:
> does it also change the /etc/passwd and all the .db files?  I was thinking
> of writing a similar script but having it read in the Solaris data and use
> the pw command to create the accounts.

All it does is generate a master.password file. You have to append it to
your master.password file by hand, and run vipw or pwd_mkdb yourself. Easy
to hack that support in, just a few system() commands. I just felt safer doing
that stuff by hand making sure I had no duplicate entries etc.

Attached is the script, since alot of people want it, and it's small.
Take your Solaris passwd and shadow file and put em in /tmp, run the
script. Now there will be a file called /tmp/amaster.passwd in FreeBSD
useable format, edit out duplicate entries, fix UIDs etc, append it
to /etc/master.passwd and run vipw or pwd_mkdb.

Used to have a version that would take a BSD master.password file and
make the appropriate Solaris files, but that was lost. Will recode it
if there is a demand for it.

-- 
	-Jason J. Horton <jason@intercom.com>
	 Moving Target 
	 Intercom Online Inc. 
	 212.376.7440 ext 21 | http://www.intercom.com
--------------C3169BDEB4C04A12B675F269
Content-Type: application/x-perl;
 name="solaris2freebsd.pl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="solaris2freebsd.pl"

#!/usr/bin/perl
################################################################################
#                                                                              #
# solaris2freebsd.pl                                                           #
#  written by Jason J. Horton and Sergey Mikhol                                #
#  for Intercom Online Inc.                                                    #
#                                                                              #
# <INSERT STANDARD BSD STYLE LICENSE HERE>                                     #
#                                                                              #
################################################################################

################################################################################
#                                                                              #
# Instructions:                                                                #
# Take your Solaris passwd and shadow file and put em in /tmp, run the         #
# script. Now there will be a file called /tmp/amaster.passwd in FreeBSD       #
# useable format, edit out duplicate entries, fix UIDs etc, append it          #
# to /etc/master.passwd and run vipw or pwd_mkdb.                              #
#                                                                              #
################################################################################

$shell	= "/sbin/nologin";

open(SHAD, "/tmp/shadow")||die"Error!";
open(PASS, "/tmp/passwd")||die"Error!";
open(MASS, ">>/tmp/amaster.passwd")||die"Error!";
while(<SHAD>){
		chop;
		($as, $bs, $cs, $ds, $es, $fs, $gs, $hs, $is) = split(/:/);

while(<PASS>){
		chop;
		($ap, $bp, $cp, $dp, $ep, $fp, $gp) = split(/:/);


print MASS "$as:$bs:$cp:$dp::/usr/home/$as:$shell\n";
}
}
close(PASS);
close(SHAD);
close(MASS);


--------------C3169BDEB4C04A12B675F269--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37F2615A.1EE6FCB6>