Operating System - HP-UX
1834163 Members
2641 Online
110064 Solutions
New Discussion

copy users to another machine

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

copy users to another machine

We have 2 identical 9000/460. I want to copy all the users from 1 machine to the other machine. How? What files do I need to grab? Is there anything in sam that has run?etc...
7 REPLIES 7
Pete Randall
Outstanding Contributor
Solution

Re: copy users to another machine

Jeff,

You'll need to copy /etc/passwd, /etc/group and /home/*, assuming this isn't a trusted system.

Pete

Pete
harry d brown jr
Honored Contributor

Re: copy users to another machine

user and group id's are a concern.

Is either a trusted machine?

How are you going to move the applications, crons, databases, ...???

The use of "sam" will depend upon what you need to do.

live free or die
harry
Live Free or Die
Shannon Petry
Honored Contributor

Re: copy users to another machine

Instead of copying /etc/passwd and /etc/group, Id recommend that you view the 2 files and compare them to the other machine. Subtle differences in several things may cause unexpected problems. I.E. /etc/publickey, different root passwords, paths, etc...

The Home directory for the users is the 2nd to last string in /etc/passwd.

Use the directory and make tar files of users home directories and then extract them on the other system.

If the reason you are doing this is to have common usernames and passwords on multiple systems, I'd recommend that you install/configure NIS.

You can achieve the server setup and client connections with SAM very easily. SAM -> Networking and Communications -> NIS

Configure the seat with all the user data as the NIS Master server, use the same utility on clients and configure them as NIS clients.

Add to this using SAM -> Networking and Communications -> NFS (Networking File System).

Export the Home directory location from the server, use the same panels to Mount the remote file system in the exact same spot on each client.

Regards,
Shannon
Microsoft. When do you want a virus today?
eran maor
Honored Contributor

Re: copy users to another machine

Hi

i will not recommend you to copy just the /etc/passwd and the /etc/group files and /home because of the issue of the user id's and primission on files .

i will recommend to use a script to add the user .

if you home dir is a nfs system you will need to add on both system the same userid on both computer .

here is a replt that my help you on this issue :

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xb31157bd90a9d611abdb0090277a778c,00.html
love computers
Anil C. Sedha
Trusted Contributor

Re: copy users to another machine

Jeff,

Follow these steps.

1) Copy the /etc/passwd & /etc/group on the other system. Diff on the original and add the new ones only

2) I have my home directories for all users under /home/systemname. If you have something like that, you can run this command from the 1st system assuming that you have NIS working. Create a default home directory location and place all users under that on the 2nd system.

cd /home/systemname(where all home directories are placed)

tar -cf - * | remsh destinationserver "cd /home/systemname; tar -xf -"

3) Make sure, that the directory permissions are fine. Normally, there should not be any issue for you as the directory permissions are retained with their current ownerships.

-Anil
If you need to learn, now is the best opportunity
Pete Randall
Outstanding Contributor

Re: copy users to another machine

Jeff,

As you can tell from the variety of answers you're getting - it depends on the situation and what you're trying to accomplish. If you're setting up a brand new machine and want to migrate to it, then the simple approach of just copying passwd, groups and home directories would suffice. If you're merging machines, it becomes more complicated.

More info would probably help immensely.

Pete

Pete
Jeff Hagstrom
Regular Advisor

Re: copy users to another machine

I am just setting up a new machine or redoing an existing maching that wasn't being used. I've tarred up the home directories, /etc/paswd and /etc/group, moved them over and everything worked fine. Thanks.