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


These are the files you would usually need to copy:

  • 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

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

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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