LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2006, 11:55 AM   #1
phonecian
Member
 
Registered: Jul 2003
Location: Au
Distribution: SLES8, centOS 3.5 & 4 servers, xandros desktops
Posts: 95

Rep: Reputation: 15
Saving user login files


Hello Forum,

I hope this is the right forum for this question??

In what may have been a malicious attack over the NFS lan one of our file servers was brought down yesterday. When I got the server started,I found the /tmp directory was full of crud packed into three huge files, created within moments of each other, which had effectively filled the /partition. After cleaning out the rubbish, a number of services cannot start any more and it seems the OS may have been damaged as well.

Rather than spend a lot of time messing around trying to find and then repair the damage, I propose to reinstall the OS to the / partition (leaving the home partitions with all the users' files in place).

To save some time getting the new OS configured, I'd like to backup and later restore the key user files for logging in and the /etc/export file. My problem is I'm not sure which files I need to backup to restore the user logins later. I want them, of course, to reconcile with the existing user folders in the /home partition.

Could someone tell me which files I have to backup. For what its worth, the server runs CentOS3.
Thanks
 
Old 04-12-2006, 12:21 PM   #2
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Rep: Reputation: 30
First of all, have your tried and fsck on the root partition? This may resolve all of your issues. Second, when you rebuild the OS, I would put /tmp on it's own partition, any user can basically DoS you if you don't have quotas enabled and tmp isn't on it's own partition. Third, the files you'll need include (this is not an exhaustive list, I'd wait while people chime in):

To Preserve your users and permission associations:

/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow
/etc/sudoers (if you have any sudoers enabled)
smbpasswd (wherever you keep that, if you are using samba shares)

These files only address rebuilding the system and having the users available again without having to enter in passwords again etc, I'm not sure what services you're running but you'll want to backup those configuration files as well. ***CAUTION*** When you have the system rebuilt, don't just copy and paste these files in place, use the commands vipw (to add users) and vigr (to add their groups) to add the necessary users/groups without replacing system accounts. Although a new system install should mirror system accounts, I'm not completely certain of that, and if you were to just copy the files into place you might break something that you don't want to.

HTH.
Mike.
 
Old 04-12-2006, 12:54 PM   #3
phonecian
Member
 
Registered: Jul 2003
Location: Au
Distribution: SLES8, centOS 3.5 & 4 servers, xandros desktops
Posts: 95

Original Poster
Rep: Reputation: 15
Mike,
Thanks for this answer. I'd never thought of putting /tmp into a separate partition. Sounds like a good idea that could have spared us a big problem. I dont know these other commands yet so I'll go look them up.
Many thanks
 
Old 04-12-2006, 01:00 PM   #4
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Rep: Reputation: 30
No problem, the other commands I mention are just the vi editor, but they lock the passwd and group files while your editing them to ensure that nobody else can make changes to the files. I forgot one other command for restoring the sudoers file: visudo, same concept as the others.

Good Luck!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
power saving mode at login screen hari78 Linux - Newbie 1 03-07-2005 10:43 AM
Saving and restoring user sessions apachedude SUSE / openSUSE 0 12-27-2004 06:33 PM
Saving User-Created Variables feetyouwell Programming 3 02-15-2004 09:56 PM
Which files contain individual user login / logout commands andrewstr Red Hat 5 12-17-2003 05:34 PM
Saving a Blackbox session so it loads at next login? deepsix Linux - Software 1 07-22-2003 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:00 PM.

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