Transferring user from one server to another

I need to transfer users from one server to another.
For testing i tried to add a user into one server and copy its details from /etc/passwd, /etc/groups, /etc/master.passwd to other server created his home directory (couldnot chown) and login but this failed.

Can anyone suggest me how to do this? If this has been discussed earlier please give me the link.

Code:
TestServer# chown testing1:testing1 testing1/
chown: testing1: Invalid argument

Server Details
Code:
FreeBSD TestServer 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007     
[email]root@dessler.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  i386
 
swapnesh said:
For testing i tried to add a user into one server and copy its details from /etc/passwd, /etc/groups, /etc/master.passwd to other server created his home directory (couldnot chown) and login but this failed.
This rarely works. Mainly because the password database aren't updated. See pwd_mkdb(8). Probably the easiest is to just recreate the account(s) with pw(8).
 
Thanx sirdice.
I have to migrate around 400 users, and don't want to change there password. Is there any other way i can transfer this accounts without involving users?
 
Theoretically*, I would think you could:
  1. create all the users with a pw(8) script; be sure to preserve the UIDs/GIDs!
  2. copy only the needed master.passwd entries from the old host to the new host
  3. build the secure db from master.passwd using pwd_mkdb(8)

In this way, pw(8) takes care of all the heavy lifting for you, and with the later steps you're able to reuse existing user password hashes.

-------

* Caveat: I don't have a FBSD crash-and-burn box to test this on at the moment. Take backups first and proceed at your own risk.
 
I've done this a few times. Use vipw to open the password database, copy and paste to the new machine, copy group entries and done! Vipw handles all the master.passwd work for you.
 
Back
Top