UNIX Hints & Hacks

ContentsIndex

Chapter 1: Topics in Administration

 

Previous ChapterNext Chapter

Sections in this Chapter:

1.1 Collecting System Information

 

1.7 Swap on-the-Fly

 

1.13 Remove the ---- Dashes ----

1.2 Backup Key Files!

 

1.8 Keep It Up with nohup

 

1.14 echo Does ls

1.3 Execution on the Last Day of a Month

 

1.9 Redirecting Output to Null

 

1.15 Building Large Dummy Files

1.4 Dealing with Unwanted Daemons

 

1.10 Keeping Remote Users Out

 

1.16 Burning-in Disk Drives

1.5 Keep Those Daemons Running

 

1.11 Rewinding Tapes Fast

 

1.17 Bringing a System Down

1.6 fuser Instead of ps

1.12 Generating a Range of Numbers

 

 

1.2 Backup Key Files!

1.2.1 Description

1.2.1 Description

One of the very last things that should be finished before moving a system into production is to back up all the key files to another spot on the system.

Example

Flavors: AT&T, BSD

Kernel  This should be the first file backed up. If it gets deleted you can restore it back. This file is often named /kernel, /unix, or /vmunix.

Password File   Having a backup of the password file is a good idea, in case the system password file gets compromised. This is the file referred to as /etc/passwd.

Group File   Back this up for similar reasons as you do a password file. This file is /etc/group.

Host Table   Make an extra copy of the host table, in case the file is corrupted or entries are removed and then needed in the future. This file is named /etc/hosts.

Filesystem Table   This is for recovery of the filesystem configurations. This file is often called /etc/fstab or /etc/vfstab.

Sendmail Config Files   If anyone works with sendmail, back these up for sure. If mail breaks, the quickest recovery is to restore from the backed up config files. These would be /usr/lib/sendmail.cf, /usr/lib/sendmail.fc, and /usr/lib/sendmail.mc.

Inetd Configs  This file has been known to get misconfigured and is a target for hackers. This is the file /etc/inetd.conf.

TTY settings   If you have any specialized devices attached, these should be backed up. These settings are typically found in /etc/inittab, /etc/ttytab, and /etc/ttys.

Start Up Scripts   Any special scripts that get started at boot time should be kept in another area. These files would usually reside in the /etc/init.d or /etc/rc#.d directories.

Reason

It is quicker to restore small, necessary files from disk than from tape. For security monitoring, the files can be checked periodically to see whether any of the system files were compromised.

Real World Experience

Reserve 5-10MB on another disk for vital data. If a second disk isn't available, use a partition other than any of the partitions that the backed up files live on. If all the files being backed up are on the root (/) partition, store the files in the /usr/ partition. Make sure that all the files maintain the same ownership and permissions as the original system files.

Some flavors of UNIX don't expect a lot of space in the root partition. Users sometimes see the root partition 95% or more full, view the lack of disk space as an immediate problem, and remove any large files that catch their attention, including the largest one at the top of the tree: the kernel file. It is usually one of the first to go. This isn't something that happens a lot, but if there is a backup nearby, the user can be up and running in no time.

In addition to having a copy of these files, you have the opportunity to check the system files against the backup files to see whether any were compromised.

UNIX Hints & Hacks

ContentsIndex

Chapter 1: Topics in Administration

 

Previous ChapterNext Chapter

Sections in this Chapter:

1.1 Collecting System Information

 

1.7 Swap on-the-Fly

 

1.13 Remove the ---- Dashes ----

1.2 Backup Key Files!

 

1.8 Keep It Up with nohup

 

1.14 echo Does ls

1.3 Execution on the Last Day of a Month

 

1.9 Redirecting Output to Null

 

1.15 Building Large Dummy Files

1.4 Dealing with Unwanted Daemons

 

1.10 Keeping Remote Users Out

 

1.16 Burning-in Disk Drives

1.5 Keep Those Daemons Running

 

1.11 Rewinding Tapes Fast

 

1.17 Bringing a System Down

1.6 fuser Instead of ps

1.12 Generating a Range of Numbers

 

 

© Copyright Macmillan USA. All rights reserved.