Operating System - HP-UX
1753798 Members
7310 Online
108805 Solutions
New Discussion юеВ

Re: Copy user accounts to another systems

 
SOLVED
Go to solution
candyman_1
Advisor

Copy user accounts to another systems

Hello All

I want to copy all the Userids and thier passwords from a trusted system to a new system. I tried copying /etc/passwd, /etc/group and /tcb. but it didnt worked. could anyone help please.

Thanks

Candyman
2 REPLIES 2
Tim Nelson
Honored Contributor
Solution

Re: Copy user accounts to another systems

For this purpose I have a script that copies this and other system info. I do extract the users in /etc/passwd to use in the script that runs useradd. This makes sure the home dirs and .profiles get created.

You can do this the way you mentioned. You may need to execute pwconv to sync the tcb files. I have not directly copied the /etc/passwd but I have directly copied the /tcb/files/auth structure to sync passwords.




Eddie Warren
Valued Contributor

Re: Copy user accounts to another systems

I've used this HP doc and it seems to work fine. Hope it helps you.

-------

Trusted system: How to copy configuration to another system


DocId: USECKBRC00007680 Updated: 7/31/02 11:23:00 AM

PROBLEM
The company is migrating to a new system, and the users need to be moved from
the old system. How is this accomplished when the old system is "trusted?"

The supported way to migrate users would be to untrust the system and transfer
over /etc/passwd, /etc/group, and /home. If for some reason this is not
possible, then the following procedure (although not supported) should work.

RESOLUTION
On the "source" system:

1. Archive the trusted computing base:

# cd /
# tar cvf tcb.tar tcb .secure

2. Archive the passwd and group files:

# cd /etc
# tar cvf pw_gr.tar passwd group

3. Archive the user home directories (by default, it will be /home).

# cd /
# tar cvf home.tar home

4. Archive the cron information.

# cd /var/spool/cron
# tar cvf cron.tar .cronaids .ataids


5. Transfer tcb.tar, pw_gr.tar, home.tar, and
cron.tar to /tmp on the "target" system. (If /tmp isn't large enough,
transfer the files to a larger filesystem.)

On the "target" system:

1. Make backup copies of the passwd and group files:

# cd /etc
# cp passwd passwd.orig
# cp group group.orig

2. Make copies of /tcb and .secure, if the system is presently "trusted."

# cd /
# mv tcb tcb.orig
# mv .secure .secure.orig

3. Make a copy of the cron files, if the system is presently "trusted."

# cp -R /var/spool/cron /var/spool/cron.orig

4. Move the passwd and group files into place:

# cd /etc
# tar xvf /tmp/pw_gr.tar

5. Move the new tcb and .secure directories into place:

# cd /
# tar xvf /tmp/tcb.tar

6. Move the new /home into place:

# cd /
# tar xvf /tmp/home.tar

7. Move the new cron files into place:

# cd /var/spool/cron
# tar xvf /tmp/cron.tar



NOTE:
It is a good idea to have more than one root terminal session open during this
process. If only one session is open, and the terminal session closes before the
procedure is complete, it may not be possible to login to the system.

Also, when users login to the system for the first time, they may be asked to
change their password.