1835200 Members
2459 Online
110077 Solutions
New Discussion

migrating user accounts

 
SOLVED
Go to solution
A Pandey
Frequent Advisor

migrating user accounts

hi folks,

i am trying to migrate 500 user accounts from the main HPUX 11.00 box to a backup solaris 9 box which needs /etc/passwd /etc/shadow and /etc/group.

on the HPUX i have only /etc/passwd and /etc/group...

what can i dow for /etc/shadow?

thanks,

abhimanyu.

p.s. something to do with trusted system?
4 REPLIES 4
Rick Garland
Honored Contributor
Solution

Re: migrating user accounts

Going from HP to SUN you will probably need to run through the useradd command.

cat out the passwd file and get specific fields such as the acct name, the UID, the GID, etc. (You want to keep the same UID/GID?)
cat /etc/passwd | awk -F: {print $1, $2, $3, $4, $5, $6, $7}' > /tmp/addusers This file will now have 6 fields separated by white space.

You can use this output to feed into the useradd command on the SUN.

Put this file on the SUN box.
cat /tmp/addusers | while read line
do
useradd -u $3 -g $4 -d $6 -s $7 -c "$5" $1
done

This will create the /etc/shadow file for you on the SUN.

Double check the syntax for a SUN box.
You can add more options to the SUN command such as -m, -k /etc/skel, etc

This is not transferring the passwds. You can take the encrypted passwds from HP and use on SUN.
Jeff_Traigle
Honored Contributor

Re: migrating user accounts

A much simpler approach that might work is to copy the passwd entries for the users from HP-UX (assuming it's not Trusted so the hashed passwords are contained in it) to Solaris... append them to the existing Solaris /etc/passwd file most likely. Then run pwconv on Solaris. On HP-UX pwconv converts the normal entries in /etc/passwd to Trusted entries with appropriate auth files under /tcb. On Linux (and I presume Solaris), it converts to and from shadow passwords.
--
Jeff Traigle
Prashant Zanwar_4
Respected Contributor

Re: migrating user accounts

Yep I do practise like jeff said..
Take it to Solaris box, update password file.. and run pwconv..
Thx
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
A Pandey
Frequent Advisor

Re: migrating user accounts

ty both.