Moving passwd file to new server
If one has 500 users on a server and need to move them to another newly installed server that just has root, the one new user (GUID = 500) plus all of the entries with a GUID < 500, what is the best way to copy the users to the new computer?
|
Create tar file of /etc/passwd /etc/shadow and /home directory + Mail directory. Then restore this tar file. Becareful about root password. Copy the file /etc (passwd + shadow) and rest to the /home and mail folder.
|
As root
Code:
awk -F: '$3 >= 500 {print}' /etc/passwd > ~/pwd.txt Code:
cat ~user/pwd.txt >> /etc/passwd Cheers, Tink |
Thank you for the awk script. awk is one of those Linux/unix treasures I have not explored (partially because it is quite intimidating).
|
Welcome - were you brave enough to test the
other bits? :} |
Here's a nice awk intro, with further links :)
http://www.oracle.com/technology/pub...laney_awk.html |
All times are GMT -5. The time now is 04:17 AM. |