| | | 4.15 System Administration |
4.15 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
, or tar
).
- 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 is script
command. It will produce a file called
typescript.
- Backup and Restore
- Look in your area with the
du
command
to find a subdirectory with less than 1 Mbyte of data.
-
Use
tar
to 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 a tar
file in /var/tmp/ with your
user-name as the file name. tar
will try to tar
its 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 the gzip
command. Compress the files using the gzip
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 the tar
file to restore your files.
The first cd
will 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.
tar
defaults 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 your backup-dir
and the original subdirectory.
Remember to print all of your results together as a single printout
for this lab.
- Monitoring the System
- Use the
df
command to look at the file systems on gort.
Save a copy of the results.
- Use the
mount
command to look at the file systems mounted on
the system. Append this to your output.
- Use
finger
, ps -ae
, and ps -al
to see
what else is on the system.
ps
is 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
top
command.
This shows the top processes on the system.
End the command with a q
.
- 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
dmesg
command 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-dir
to remove all
of the files and the new backup-dir
sub-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.15: System Administration
and the results of the file compression.
Instructor: ltaber@pima.edu ** My new Home at GeoApps in Tucson ** The Pima College Site
| | | 4.15 System Administration |