LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-09-2003, 10:30 PM   #1
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Rep: Reputation: 30
Backup User File


I have one quick question, I would like to know what I have to do to backup the usernames and passwords for my linux servers. I have all my servers doing a nightly backup of all the important data, the only thing I can't redo from my backups is putting in the usernames and passwords, do I just have to backup the user file and the shadow file? and how do I do that? Thanks
 
Old 07-10-2003, 01:18 AM   #2
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
just cp /etc/passwd <whereyouplaceyourbackup>/passwd.bak
and cp /etc/shadow
<whereyouplaceyourbackup>/shadow.bak
would suffice.
I don't think that there is need to compress and tar the files as they are very small.Just make sure that other users could not get them.
If you want you can use cron to backup the files daily.
Read the man pages for howto do that!
 
Old 07-10-2003, 06:28 AM   #3
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Original Poster
Rep: Reputation: 30
Thanks, I thought that was what I needed to do, now my next question, say my server just blows up, hard drive is smoking, I do a compleate rebuild. When I copy those two files over and overwrite the ones that are there is that all I need to do to have my usernames there?

Oh and the cron stuff is not a problem, I already have all my backups running from cron every night, I just wanted to add my password files to my nightly backups.
 
Old 07-10-2003, 06:47 AM   #4
ionstorm
Member
 
Registered: Jul 2003
Location: United Kingdom
Distribution: Slackware 8.0, 8.1, 9, 9.1 Crux 1.1,1.2
Posts: 80

Rep: Reputation: 15
Yep. You just copy them back over.

Are you sure you dont want to back up /etc/group too?

Ion
 
Old 07-10-2003, 08:06 AM   #5
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Original Poster
Rep: Reputation: 30
Actually what I am thinking is that I should just be backing up the whole /etc directory, In the beginning I was only worried about the data but I am not sure I would want to have to redo all my configs if my servers blew up :-)
 
Old 07-10-2003, 08:39 AM   #6
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
I think that would be ok and it would also not take huge amount of space.But this time around you may have to compress(preferably bunzip2 even though it is slow and heavy on resources) and tar the files.
But I have never know any sysadmins backing up the whole /etc/ directory.They just backup the configs that are used regularly and they back up the configs once only every 1-2 months and they backup the /etc/passwd ,/etc/groups,/etc/shadow everyday coz they are being changed everyday.
 
Old 07-10-2003, 08:57 AM   #7
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Original Poster
Rep: Reputation: 30
The way I have my servers set up is they run the smaller directories I want backed up through bunzip2 and put in a directory on the server. I then have my main data directory on the server shared out over nfs the nfs only exports to my main backup server, My backup server then pulls over all my data and the gzip file and does a tar.gz on them.

By doing it that way all the proccessor power is being used on my backup machine and not on my server so my server does not slow down during the backups. My backup server starts the backup on one server at 1:00am then the next at 2:00am and so forth, this has worked real nice for me thus far I am just trying to get my backups perfected :-)
 
Old 07-10-2003, 09:10 AM   #8
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Quote:
Originally posted by cli_man
The way I have my servers set up is they run the smaller directories I want backed up through bunzip2 and put in a directory on the server. I then have my main data directory on the server shared out over nfs the nfs only exports to my main backup server, My backup server then pulls over all my data and the gzip file and does a tar.gz on them.
Since you are trying to perfect your backups I see 1 or 2 problems here,
1.Are you using bunzip2 and gunzip on the same files after they are tarred?
If it is then it would be pretty useless,as they use different algorithms.Bunzip2 is a block sorting algorthm and offers better compression than gzip(usually 30-40%).The real problems with bunzip2 is not only about resources(it basically eats up the CPU),but also that it can't be used for streaming(but maybe you don't require that feature).Next if you compress your data using bunzip2 they are compressed to the maximum,if you use gzip on them they can't possibly be compressed more.
2.I think you bunzip2 each of the files and then you send them to your server where it is tarred and gzipped if I understood it.Instead of that you could do send the bunzip2 files over the server and only tar them there.
Finally your ideas are definately ingenious.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
user backup permissions wmorrow Linux - Security 3 10-26-2005 09:22 AM
making a backup of user / program settings Cinematography Linux - General 17 05-13-2005 11:42 PM
user information and data backup wenberg Linux - General 1 01-26-2004 03:21 AM
User Names & passwords Backup teeno Linux - General 8 04-07-2003 09:17 AM
backup and update the backup file doris Linux - General 4 08-24-2002 07:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration