Operating System - HP-UX
1833053 Members
2712 Online
110049 Solutions
New Discussion

Transfering of users to a newv system

 
machaya chivaviro_2
Occasional Advisor

Transfering of users to a newv system

I am buying a new server which will be running HP-UX 11i and I have one with HP-UX 11.
I have 500 users. I need to copy users and their passwords to the new server. How do I do that.
6 REPLIES 6
Jeff_Traigle
Honored Contributor

Re: Transfering of users to a newv system

If you current system is a trusted system, copy /tcb.
Copy /etc/group and /etc/passwd.
Copy the home directories.
--
Jeff Traigle
Rick Garland
Honored Contributor

Re: Transfering of users to a newv system

In a trusted system
Get the tcb tree, /etc/passwd, & /etc/group.

In a non-trusted system
Get the /etc/passwd & /etc/group

In both cases, get the users home directories.

Devender Khatana
Honored Contributor

Re: Transfering of users to a newv system

Hi,

For non trusted systems just copy /etc/passwd and /etc/group files. Alongwith this copy there home directory structure with same permissions.

HTH
Devender
Impossible itself mentions "I m possible"
Raj D.
Honored Contributor

Re: Transfering of users to a newv system

Hi Machaya ,

Here is something , that will be useful while transfering the users to the new system :


1. # rcp /etc/passwd newserver:/myusers/


2. Here is a script that needs to run on the new server:


###########################################
# script for trasfering users from old server to newserver .
cat /myusers/passwd |while read line
do
USER=$(echo $line|awk '{FS=":";print $1}')
PASS=$(echo $line|awk '{FS=":";print $2}')
USERID=$(echo $line|awk '{FS=":";print $3}')
GID=$(echo $line|awk '{FS=":";print $4}')
INFO=$(echo $line|awk '{FS=":";print $5}')
HOME=$(echo $line|awk '{FS=":";print $6}')
SHELL=$(echo $line|awk '{FS=":";print $7}')
echo "Adding $USER"
useradd -u $USERID -g $GID -s $SHELL -c "$INFO" -o -m -k /etc/skel -d $HOME $USER
/usr/sam/lbin/usermod.sam -p`echo "$PASS"` $USER
done
##########################################


Run this script on the newserver.

3. Restore the /home on newserver, to get all $HOME data , into all users home directory.



Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Sยภเl Kย๓คг
Respected Contributor

Re: Transfering of users to a newv system

Hi,

If ur system is not in trusted mode, all that u need to do is

1. Copy /etc/passwd and /etc/group of the old server to the new server. Ensure that you have opened few consoles with root login before copying the files, so that if any problem is there you can at least change root password.
2. Replicate the home directires of all users with same permissions.

And if ur system is in trusted mode,
1. first of all you need to convert the new system in to trusted mode, with the same policies of the old server(Like Max password length, password aging etc..)
2.Copy /etc/passwd and /etc/group of the old server to the new server
3.Copy /tcb directory of old server in to the new server.
4. replicate user home directories with same permissions.

Wish you all success !!!

Regards,
Sunil
Your imagination is the preview of your life's coming attractions
Joel Girot
Trusted Contributor

Re: Transfering of users to a newv system

If your old system is non-trusted but use shadow passwords, install shadow passwords tool on new system and copy /etc/shadow /etc/passwd /etc/group