Is there a way to copy user list (with data and passwords) from one server to another.

We have two servers and one of those is new. I need to create same users (that exist in /home/) and set same passwords (if possible) sure /home/ dir will be copied also for the configs.

To be specific its Ubuntu server 10.04.1.

Linux <name> 2.6.18-238.5.1.iv.028stab085.3 <time> i686 GNU/Linux

link|improve this question

feedback

2 Answers

up vote 5 down vote accepted

These are the files you would usually need to copy:

/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow
/home/$USER
/var/mail/$USER
/var/spool/cron/crontabs/$USER
link|improve this answer
What about other users (www-data or ftp)? Won't the ID's mix up? – JackLeo Jun 1 '11 at 19:06
@JackLeo - if the servers are both Ubuntu, then the system accounts should all have the same IDs (if they didn't, upgrades wouldn't work). – JimB Jun 1 '11 at 20:19
feedback

You'll need to copy /etc/passwd, /etc/shadow and /etc/group along with the home directories

link|improve this answer
You forgot at least about mail spools and cron tabs. – AlexD Jun 1 '11 at 14:48
Also forgot gshadow. While group passwords are rarely used anymore, some tools will throw errors if group and gshadow are out of sync. – JimB Jun 1 '11 at 15:09
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.