book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!







This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

Unix, Xenix and ODT General FAQ

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

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:


Hate these ads?



 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".

J.P. Radley abserved: "it be easier to ditch the shadow file and reconstruct it, by running pwunconv, grabbing a copy of /etc/passwd, then running pwconv?".





ad

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner

cartoon
Need eyes on the ground at your customer's site?
Installation and light training Boston and New England
Reliable and experienced, punctual and professional.


Views for this page
Today This Week This Month This Year  Overall
2273838 3,579

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

pavatar.jpg
More:




Unix/Linux Consultants


http://www.schewanick.com SCO Unix, Solaris, Linx (various), PHP, MySQL, Apache, uniBasic, dL4, Perl, System Administration and more....


SCO, OpenServer, UnixWare, software, servers, security, networks, installation, administration, troubleshooting, maintenance, Watchguard, firewalls, VPNs, e-mail. Visit us at Open Systems Computing and www.go2unix.com.


http://www.vss3.com SCO/Caldera OpenServer, Unixware & Linux. Tarantella & Non-stop Clustering



Twitter
o 'Nuff is enough.. time to zombie out. 3:38 PM Mar 2nd 2008








Change Congress