CT320

Three headers follow: ! Long name of class !! Semester !!! R 2, replaced by the name of the current page.

CT320: Network and System Administration

Fall 2013

R 2

Links to the various pages for this class:

Wish I could do this: * Schedule

Recitation 2 (R2)

CT 320: Network and Systems Administration

Group Project

System Admin, Process Control, Periodic Processes

The purpose of this assignment is to learn (or review) some of the standard system administration functions on a Linux system, including account administration, process control, and periodic processes. Use the script command to capture the output of all commands in R2.log, for submission at the end of the recitation.

Part 1 – Account Administration

  1. Become the root user with the su root command (ask TA for the password).
  2. Use groupadd to define presidents, governors, mayors, and senators groups.
  3. Use groupmod to change the GID for senators.
  4. Use groupmod to restore the GID for senators.
  5. Use groupdel to delete the senators group.
  6. Use grep to search /etc/group for group names and GIDs.
  7. Use useradd to add users with the following attributes:
User NameHome  DirectoryPasswordShellPrimary GroupSecondary Group
taft/home/taftwilliam/bin/bashuserspresidents
wilson/home/wilsonwoodrow/bin/bashuserspresidents
lincoln/home/lincolnabe/bin/bashuserspresidents
adams/home/adamsjohn/bin/bashuserspresidents
grant/home/grantulysses/bin/bashuserspresidents
  1. Login to the lincoln account and verify that the shell is /bin/bash.
  2. Use usermod to change the shell to /bin/tcsh for lincoln.
  3. Login to the lincoln account and verify that the shell has changed to /bin/tcsh.
  4. Use su and passwd to change the password for grant.
  5. Login to the grant account with the old and new passwords.
  6. Use userdel to delete the grant account.

Part 2 – Process Control

  1. Look at the manpage for ps.
  2. List the processes using ps with the -e, -f options.
  3. List the processes using ps only for root.
  4. List the process tree using the pstree command.
  5. Look at the manpage for the top command.
  6. List the processes using top.
  7. Rerun top with 1s between screen updates.
  8. Rerun top only with your process.
  9. Launch a gedit session and find the associated PID using ps and grep.
  10. Kill the gedit session using the kill command with the SIGKILL signal.

Part 3 – Periodic Processes

  1. Look at the manpage for crontab: -e to edit, -l to list, -r to remove.
  2. Create a crontab file using crontab commands with the following attributes:
    1. Runs every minute, every weekday, every month, etc.
    2. Executes a find . -print command from your home directory into R2.cron.
  3. Verify that the crontab is executing correctly by looking at /var/log/cron.
  4. Write a bash script called R2.script that executes ls -l in your home directory.
  5. The script should log results to a file called R2.cron in your home directory.
  6. The script should log the date and time each time it runs.
  7. Remove the original crontab entry and substitute a new one with the script.
  8. Have the script run with the same period as the previous crontab.
  9. Verify that the crontab is executing correctly by examining R2.cron.
  10. Use cat to list R2.script and R2.cron into R2.log.

Part 4 – Checkin

Terminate the script command with control-D. Edit your output to have only the relevant commands, filtering out all extraneous commands and output. Add a comment block with your personal information, as follows:

    # Students: Student 1, Student 2, ...
    # Ids: 8xx-xx-xxxx, 8xx-xx-xxxx, ...
    # Course: CT320
    # Assignment: Recitation R2
    # Date: YYYY-MM-DD

Turn your file into the Recitation 2 drop box on RamCT. You do not need to turn in R2.script or R2.cron from above, since R2.log will contain their contents. The lab is done in teams of 2, but each student must submit to get credit.

Modified: 2013-09-06T12:48

User: Guest

Check: HTML CSS
Edit History Source
Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2015 Colorado State University
CS Building