|  |  |  | 4.16 System Administration | 
4.16 System Administration
The term "system administration" covers a lot of areas.  If 
you are a good Unix systems administrator, you have many different 
tasks to deal with and you have the root password.  On gort, 
students don't know the root password, 
so what can be done is limited. (At least they aren't suppose to know the
root password!) 
If you have a system available with the root password do the 
following:
- Back up the system (dump,rdump, ortar).
- Add a new user.
- Create a list of all executable set user id and set group id files owned by 
root with file lengths and modification times.
- Restore a file from your backup.
If you are using gort for the system administration lab I would like
you to produce a single annotated printout.  So as you go through the
following
steps save your output into a file that you can edit later.  One way of
doing this isscript command.  It will produce a file called
typescript.
 
- Backup and Restore
- Look in your area with the ducommand 
to find a subdirectory with less than 1 Mbyte of data.
- 
Use tarto create a file that contains all of the files in 
your<1Mbyte area.  The command should look something like 
this: 
cd /var/tmp/ 
tar -cvf your-user-name.tar ~/  
 This will create atarfile in /var/tmp/ with your 
user-name as the file name.tarwill try totarits own output
if given the chance.
- Do a 
ls -l
 to find out the size of the archive file prior to 
the compression.  Write down the size of the file; it will be deleted 
by thegzipcommand.  Compress the files using thegzip 
gzip your-user-name.tar
 Compare the size of
your-user-name.tar 
 and
your-user-name.tar.gz
 Write 
the result of your comparison on your final output.
- (Optional) Copy this to a floppy disk using scp. 
There are PC systems in the Academic Computing Center, Santa Catalina building, room C202
that can be used to do this, or you can do it
over the Internet.
Make sure that the file is transferred as a binary file.
- Create a new subdirectory in your area (called "backup-dir"). 
Uncompress your file into this area, then expand thetarfile to restore your files.
The firstcdwill take you back to your home directory. 
cd
mkdir backup-dir 
cd backup-dir 
tar -xvzf /var/tmp/your-user-name.tar.gz
 The -x option is for "eXtract".
The -v option is for verbose.  It will list the file names.
The -z option will decompress the tar file on the fly.
The -f option is for a following file name.tardefaults to a tape drive.
- Save a copy of a recursive directory to be turned in.  
For this lab turn in all of the requested commands together 
as a single printout.  
cd
ls -lR 
 This should include yourbackup-dirand the original subdirectory. 
Remember to print all of your results together as a single printout 
for this lab.
 
- Monitoring the System
- Use the dfcommand to look at the file systems on gort. 
Save a copy of the results.
- Use the mountcommand to look at the file systems mounted on
the system.  Append this to your output.
- Use finger,ps -ae, andps -alto see 
what else is on the system.psis a process status program.  
It shows what you and other people have running. 
Append the results of these commands to the file from the previous step.
- Run the topcommand.  
This shows the top processes on the system.
End the command with aq.
- Look for suid programs owned by root.
find /usr/bin -user root -perm -4000 -print
 Append this file to your printout.
 
- System maintenance
- Use the following command to copy a set of files keeping 
the existing permission bits.
cd
mkdir from-dir
mkdir to-dir
cd from-dir
** Put some files in the from-dir directory **
tar -cf - . | ( cd to-dir; tar xvf - )
 Make sure that the to-dir is not in the from-dir.
You may want to remove both from-dir and to-dir.
- Use the dmesgcommand to see the 
"power-up" messages for the system.  
Include this information in your  "turn-in" file.
- Clean up your section of the file system by removing unwanted 
files and directories.  You can use rm -r backup-dirto remove all 
of the files and the newbackup-dirsub-directory.  Keep your 
floppy as long as you want it. 
Also delete /var/tmp/your-user-name.
 
Turn in the printout and mark it with:
your-name
TABER CIS137
Lab 4.16: System Administration 
and the results of the file compression.
Instructor: Louis Taber, ltaber(at)uml.lt.Tucson.AZ.us (520) 206-6850
My new web Home page in Cleveland, OH 
The Pima Community College web site
    |  |  |  | 4.16 System Administration |