How to copy all user on from one linux server to another linux server?
If you just want to have the same users in the new system, you can get the list of users in your old server and add them in the new server with useradd
within a loop as follows:for i in $(cat users_list); do useradd $i; done
Note that this won't migrate the users data as you didn't mention it.If you want to migrate the users with their old password and data, you can copy the lines concerning the users you want to migrate on files:
- /etc/passwd
- /etc/group
- /etc/shadow
Now you may also copy the /home directory structure to your new sytem, so that the users can have access to their data.
No comments:
Post a Comment