LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   move user account to another server (https://www.linuxquestions.org/questions/linux-newbie-8/move-user-account-to-another-server-4175527140/)

byran cheung 12-02-2014 07:43 PM

move user account to another server
 
I have a web server , there are many FTP account and mysql account in it , I would like to move these account to another server , if I newly create these account , the password will be changed as I do not know user password , would advise how can I move these system account but keep the same password in new server ? thanks

wpeckham 12-02-2014 09:14 PM

Google is your friend!!
 
There are some fine WIKI and HOW-TO pages that cover this better than I can, but here is the cheatsheet:
First, check for collisions in the following. You may have trouble doing it this way if UID or PID collisions are involved.
1. Tar up the home folder, if approriate. Unpack this in proper location on new server.
2. Copy the entries for the user in /etc/group and replciate on the new server.
3. Copy the line for this user from /etc/passwd and add that line to the new server.
4. Copy the line for the user from /etc/shadow and add it to /etc/shadow on the new server.

You may also have to check /etc/gshadow if it is used. Most often not.

Test the account and verify permissions, ownership, shell, etc.


If you are obsesive, you could alos migrate the mail file for the user. I seldom find that useful, but only you can tell if it is approriate.

NOTE 1: These assume you do not make major use of NIS/NIS+, LDAP, WINBINDD or other tools that tie users to central management, group, or domain.
NOTE 2: if you are NOT using the shadow system, it is even less difficult but your systems are FAR less secure!

SAbhi 12-02-2014 09:15 PM

what type of FTP setup do you have ?

mysql can be moved by moving database, take a dump and move it to another server--> restore it and start service.

byran cheung 12-03-2014 12:33 AM

Quote:

Originally Posted by wpeckham (Post 5278532)
There are some fine WIKI and HOW-TO pages that cover this better than I can, but here is the cheatsheet:
First, check for collisions in the following. You may have trouble doing it this way if UID or PID collisions are involved.
1. Tar up the home folder, if approriate. Unpack this in proper location on new server.
2. Copy the entries for the user in /etc/group and replciate on the new server.
3. Copy the line for this user from /etc/passwd and add that line to the new server.
4. Copy the line for the user from /etc/shadow and add it to /etc/shadow on the new server.

You may also have to check /etc/gshadow if it is used. Most often not.

Test the account and verify permissions, ownership, shell, etc.


If you are obsesive, you could alos migrate the mail file for the user. I seldom find that useful, but only you can tell if it is approriate.

NOTE 1: These assume you do not make major use of NIS/NIS+, LDAP, WINBINDD or other tools that tie users to central management, group, or domain.
NOTE 2: if you are NOT using the shadow system, it is even less difficult but your systems are FAR less secure!


it works , thanks


All times are GMT -5. The time now is 12:18 PM.