Summary : Passwd file export

From: Hisham Al Saad (
Date: Sat Jul 08 2000 - 04:08:27 CDT

Thanks to all who replied
Stuart Whitby <>
Muhammed Cinsdikici <>
gabriel rosenkoetter <>
Andrew Brennan <>
Gary Jenson <>
 John T. Douglass" <>
Sean Quaint <>
Karl Vogel" <>

Original message
Is there a way to export a passwd file containing around 2500 users from
Solaris 2.6 server to a Digital Unix 4.0E format with all its user accounts
and passwords ?


Some suggested to use awk or NIS, the majority of the replies suggeted to do
it with a PERL or a shell script.

Andrew Brennan:
it easily with a PERL script, then a pass through the DU mkpasswd to
generate the hash files.

Gary Jenson:
Try it and find out. I do this with sco-aix-hp-solaris pretty frequently.
I write a little shell script that parses the /etc/passwd and /etc/shadow
file, and cut the appropriate fields, then generate an /etc/passwd
/etc/shadow (or whatever scheme the OS likes) file and put it into place.

John T. Douglass:
The attached script came from the Crack 5.0a distribution, it merges
the shadow and password files.
The script :
# This program was written by and is copyright Alec Muffett 1991,
# 1992, 1993, 1994, 1995, and 1996, and is provided as part of the
# Crack v5.0 Password Cracking package.
# The copyright holder disclaims all responsibility or liability with
# respect to its usage or its effect upon hardware or computer
# systems, and maintains copyright as set out in the "LICENCE"
# document which accompanies distributions of Crack v5.0 and upwards.


 sed -e 's/^/STAG:/' < $SHADOW
 sed -e 's/^/PTAG:/' < $PASSWD
) |
awk -F: '
$1 == "STAG" {
 pw[$2] = $3;
$1 == "PTAG"{
 $3 = pw[$2];
 print $0;

}' |
sed -e 's/^PTAG://'
Usage: > newpasswd.file
Obviously has to be run by root.

I haven't used any of these solutions yet, but I will investigate more about
implementing one of them.


U BEFORE POSTING please READ the FAQ located at
. and the list POLICY statement located at
A To submit questions/summaries to this list send your email message to:
A To unsubscribe from this list please send an email message to:
E and in the BODY type:
R unsubscribe sun-managers
S Or
. unsubscribe sun-managers original@subscription.address
L To view an archive of this list please visit:

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:11 CDT