# # How can I transfer SCO Unix accounts (passwd information) to Linux?
APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

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

I've removed advertising from most of this site and will eventually clean up the few pages where it remains.

While not terribly expensive to maintain, this does cost me something. If I don't get enough donations to cover that expense, I will be shutting the site down in early 2020.

If you found something useful today, please consider a small donation.

Some material is very old and may be incorrect today

© December 2003 Tony Lawrence

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:

 cat scopasswdfile | while read line
 set $line
 useradd -c $5 -p $2 -s /bin/bash -d /home/$1 -m $1

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
 cat /tmp/pscopass | while read line
 set $line
 useradd -c $5 -p $8 -s /bin/bash -d /home/$1 -m $1

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

maximum uid

If converting from SCO to Linux and you desire to retain user id's, you need to be aware of these files.

For SCO, it's etc/default/accounts and etc/default/authsh.

On Linux, the file is /etc/login.defs:

# Min/max values for automatic uid selection in useradd
UID_MIN			 1000
UID_MAX			60000
# System accounts
#SYS_UID_MIN		  100
#SYS_UID_MAX		  999

# Min/max values for automatic gid selection in groupadd
GID_MIN			 1000
GID_MAX			60000
# System accounts
#SYS_GID_MIN		  100
#SYS_GID_MAX		  999

There are many options in there that are not comonly set; you should review what you can control there.

If you found something useful today, please consider a small donation.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

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


Inexpensive and informative Apple related e-books:

Take Control of Apple Mail, Third Edition

Take Control of Pages

Take Control of Parallels Desktop 12

Sierra: A Take Control Crash Course

iOS 8: A Take Control Crash Course

More Articles by © Tony Lawrence

Tue May 3 19:14:38 2005: 434   anonymous

do we need to decode the password? thanks

Tue May 3 19:41:40 2005: 435   TonyLawrence

No. The script should work as is.


Printer Friendly Version

Have you tried Searching this site?

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.

Contact us

Printer Friendly Version

The successful construction of all machinery depends on the perfection of the tools employed; and whoever is a master in the arts of tool-making possesses the key to the construction of all machines... The contrivance and construction of tools must therefore ever stand at the head of the industrial arts. (Charles Babbage)

Linux posts

Troubleshooting posts

This post tagged:





Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode