Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

backup user and password database in linux

Status
Not open for further replies.

gwu

MIS
Dec 18, 2002
239
US
how can i backup the users & passwords that i have created on my linux box. The purpouse: if i need to install linux on another server using the same users & passwords. Is it just a matter of copying certain files in /etc to the other machine?

thanks
 
tar -cvzf pickaname.tgz /etc/passwd /etc/shadow /etc/group

this will put the three files into a compressed archive file
 
will this work. If I had to build another machine with the same users/passwords, all i would need to do is put the back up'd files you specified into the new machine? Will the UID numbers still match for root in the file permissions?
 

Yes. root is always 0.

The new users won't have UID's so that shouldn't be a problem.
If you want to change UID of all a user's files do:

# find / -user #OLDUID -exec chown NEWUIDname {} \;

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top