Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I transfer SCO accounts (passwd information) to Linux?

Linux

How can I transfer SCO accounts (passwd information) to Linux?

by  pcunix  Posted    (Edited  )
From http://pcunix.com/SCOFAQ/scotec1.html#ilinuxpass :
If the SCO passwd file has the encrypted password in its second field (in other words, the system isn't using /etc/shadow), then this simple script will work:

IFS=":"
cat scopasswdfile | while read line
do
set $line
useradd -c $5 -p $2 -s /bin/bash -d /home/$1 -m $1
done


This requires a current version of "useradd"; the older versions don't take encrypted passwords with -p

Normally, however, the encrypted passwords will be in /etc/shadow. This needs a little more work:

sort scopasswd > /tmp/p1
sort scoshadow > /tmp/p2
join -t: /tmp/p1 /tmp/p2 > /tmp/pscopass
IFS=":"
cat /tmp/pscopass | while read line
do
set $line
useradd -c $5 -p $8 -s /bin/bash -d /home/$1 -m $1
done


Note that only the first 13 characters in the non-shadow passwd file are the encrypted password; the rest (stuff after the comma) is for password aging: see "man F passwd".
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top