Operating System - HP-UX
1837896 Members
3367 Online
110122 Solutions
New Discussion

Re: fast user setup HPUX11

 
SOLVED
Go to solution
Mahendra Luhar
Advisor

fast user setup HPUX11

I would like to replicate approximately 300 users and their existing ID's, home directory to a separate system.
Does anyone know of a shortcut script, or slick use of the useradd command to enable me to achieve this?
3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: fast user setup HPUX11

Are both systems going to have the same identical list of users? If so, you could just copy the /etc/passwd file and then create a script to create the home directories using a list of the users:

for user in `cat userlist`
do
mkdir /home/$user
cp /tmp/standardhomecontents /home/$user
done


Pete

Pete
G. Vrijhoeven
Honored Contributor
Solution

Re: fast user setup HPUX11

Hi,

Just copy the user entries form the /etc/passwd and /etc/group from the old server. For the home dirs you could use a backup /resore or a script like:
cat /etc/passwd | awk -F: '{ print "mkdir", $6, "; cp /etc/skel/.??*" , $6 "; ch
own -R", $3,$4,$6}' | sh

HTH,

Gideon
Mahendra Luhar
Advisor

Re: fast user setup HPUX11

Thanks for the advice. We managed to use the store restore.