Thanks to all who replied
Stuart Whitby <swhitby@legato.com>
Muhammed Cinsdikici <cinsdiki@bornova.ege.edu.tr>
gabriel rosenkoetter <gr@cs.swarthmore.edu>
schaefer@wolfe.llnl.gov
Andrew Brennan <andrew.brennan@drexel.edu>
Gary Jenson <gjenson@spillman.com>
John T. Douglass" <john.douglass@anlw.anl.gov>
Sean Quaint <squaint@mediaone.net>
Karl Vogel" <vogelke@dnaco.net>
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 ?
Replies,
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 :
#!/bin/sh
###
# 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.
###
SHADOW=/etc/shadow
PASSWD=/etc/passwd
(
sed -e 's/^/STAG:/' < $SHADOW
sed -e 's/^/PTAG:/' < $PASSWD
) |
awk -F: '
BEGIN {
OFS=":";
}
$1 == "STAG" {
pw[$2] = $3;
next;
}
$1 == "PTAG"{
$3 = pw[$2];
print $0;
}' |
sed -e 's/^PTAG://'
-------------------------------
Usage:
shadmrg.sv > 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.
Thanks,
S
U BEFORE POSTING please READ the FAQ located at
N ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq
. and the list POLICY statement located at
M ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/policy
A To submit questions/summaries to this list send your email message to:
N sun-managers@ececs.uc.edu
A To unsubscribe from this list please send an email message to:
G majordomo@sunmanagers.ececs.uc.edu
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:
I http://www.latech.edu/sunman.html
S
T
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:11 CDT