Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

up vote 6 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
share|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
add comment

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

share|improve this answer
    
You forgot at least about mail spools and cron tabs. –  AlexD Jun 1 '11 at 14:48
1  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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