I have a situation where I have ~10 FTP users, and I need to migrate them from one server (server A) to another (server B).

The userdata (so their files) are in /home/<username>, so moving that is as simple as an rsync job.

I also need to keep their existing usernames/passwords etc - if it's at all possible, the users shouldn't notice that they had the server switched on them.

Is there a "easy" way to do this?


Generally speaking all you need to do is migrate the relevant lines in /etc/passwd, /etc/shadow and the group variants (/etc/group and /etc/gshadow) along with home files.

You might be able to just clone these files over but I think it's probably better to strip out the system accounts which might (poor design, but they might) store their passwords around the system which might be different on your new installation.

The best guide I've seen to do this selectively is this one. Just be careful that in the end you're using >> to append the old user accounts on to the new server's files and not > which would replace them.

| improve this answer | |
  • I'm moving from an ancient Ubuntu which has root access by default (shudder) to 10.04, so I'm NOT keeping the entire system accounts :P – jrg Nov 4 '11 at 17:16
  • Just be aware that the password hashing/encryption scheme can change between versions (especially if you are going from 32-bit to 64-bit) and so copying over the passwords (/etc/shadow) may not work. – Linker3000 Nov 18 '11 at 10:24

Depends on how users authenticated. It could be against /etc/passwd, external database, internal database or even LDAP.

If it's /etc/passwd — then you need just to recreate users and copy hashes from /etc/shadow on server A to server B.

External/internal DB — just move data.

LDAP — I don't really think that you are using this one ;)

| improve this answer | |
  • Definitely not ldap. ;) – jrg Nov 4 '11 at 17:15

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.