1836584 Members
1603 Online
110102 Solutions
New Discussion

move user

 
Juno
Occasional Advisor

move user

We will change my HP UX 10.2 to linux , how can I move the UX users to linux instead of re-creating all the users again ? thx
Juno
3 REPLIES 3
Patrick Wallek
Honored Contributor

Re: move user

If the system is NOT trusted, then you could try just copying the users you want from the /etc/passwd and the appropriate groups from the /etc/group file. I wouldn't overwrite the passwd and group files already on the machine though since you would mess up your root account and possibly other system accounts.

If your system IS trusted, then you can try un-trusting it (tsconvert -r, I think) and then doing the above.

Good luck.
Michael Tully
Honored Contributor

Re: move user

If all the users home directories are say under /home, then you could backup the directories and move them across to your linux system.
Make sure that you have enough space for the archive:
# cd /home
# tar cvf /tmp/myusers.tar .

Copy file across using ftp
On linux box
# cd /home (or new directory)
# tar xvf /tmp/myusers.tar

If the system is not trusted then you can copy the entries from the existing /etc/passwd file. Beware not to include entries for root or other system accounts.
# cp /etc/passwd /tmp/passwd
ftp the file to linux box
# cp /etc/passwd /etc/passwd.save
# vi /etc/passwd
copy in the new file
:r /tmp/passwd
Remove the entries not required. Save the file.
COpy the /etc/group file as well
Anyone for a Mutiny ?
S.K. Chan
Honored Contributor

Re: move user

The part of copying the entries in the /etc/passwd and /etc/group to your Linux box should be relatively easy. Keep in mind Linux uses bash shell (/bin/bash) and in fact /bin/sh is a sym link to bash as well. The Korn shell path can be either /bin/ksh or /usr/bin/ksh. So depending on what shell is in the passwd file, you may/may-not need to change it's path. The users who wanted a option of running bash shell in Linux might need to have to create .bashrc file and it can simply be any entry in there that sources the global /etc/bashrc like so ..
..
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
..
For physically copying the users home dir, you can use tar to create a tar ball and later extract it on the Linux side.