CT320

CT320: Network and System Administration

Fall 2018

Admin

CT320: Admin

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 sudo -s
  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/shuserspresidents
grant/home/grantulysses/bin/shuserspresidents
  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 sudo 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 only the processes owned by root. Use ps only—no grep or other filtering commands.
  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 half-second between screen updates.
  8. Rerun top only with your processes.
  9. Launch a gedit session and find its PID using ps and the -C option.
  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 find -print from your home directory into R2.cron.
  3. Verify that the crontab is executing: grep -i cron /var/log/syslog
  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 — Credit

  1. Terminate the script command with control-D.
  2. Edit your output to have only the relevant commands, filtering out all extraneous commands and output.
  3. Show it to the TA

Modified: 2017-09-28T09:19

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