1. Create a new group 'dev'
  2. groupadd dev
  3. Create a new user 'alice'. Make sure she is a member of the 'dev' group. Also, set her description to "Alice from Dev", and her default shell to '/bin/csh'
  4. useradd -g dev -c 'Alice from Dev' -s /bin/csh alice
  5. Check the log files and look for the log entries generated by adding alice to the system
  6. fgrep useradd /var/log/secure
  7. Create a new group 'mktg'
  8. groupadd mktg
  9. Create a new user 'bob' as a member of group 'mktg' and secondary member of the 'dev' group. Lock his account after you create it.
  10. useradd -g mktg -G dev bob; passwd -l bob
  11. Modify user 'bob' and make his primary group 'dev' and his secondary group 'mktg'.
  12. usermod -g dev -G mktg bob
  13. Unlock user 'bob'
  14. passwd -u bob
  15. Set the minimum password lifetime on 'bob' and 'alice' to 21 days, and the maximum lifetime to 45 days
  16. passwd -n 21 -x 45 bob; passwd -n 21 -x 45 alice
  17. From the '/' directory, create a tar file backup of the home directory
  18. cd /; tar cf home.tar home
  19. Create a new directory, '/backups'
  20. mkdir /backups
  21. Set the permissions on the '/backups' directory to read/write/execute for owner, and no perms for everyone else
  22. chmod 700 /backups
  23. Using the highest compression level, compress your backup with gzip and move it to the '/backups' directory
  24. gzip -9 /home.tar && mv /home.tar.gz /backups
  25. Startup a 'netstat 1' command in the background. Make sure to redirect it's output to a file, so it isn't cluttering up your screen!
  26. netstat 1 > output &
  27. Stop your job
  28. kill -STOP %1
  29. View the results of the job so far, in it's output file. You should see lots of information about all the network connections currently existing on your computer.
  30. less output
  31. Check the size of the file. Wait 5 seconds, check it again. Make sure it isn't growing.
  32. ls -la output; sleep 5; ls -la output
  33. Start the job running again.
  34. kill -CONT %1
  35. Check the size of the file. Wait 5 seconds, check it again. Make sure it *is* growing.
  36. ls -la output; sleep 5; ls -la output
  37. Go ahead and kill the job.
  38. kill %1
  39. Going back to your home directory backup. cd into the '/tmp' folder. Extract your home backup. Check that the extract worked by comparing the '/tmp/home' folder with the '/home' folder.
  40. cd /tmp; gzip -dc /backups/home.tar.gz | tar xf - ; ls home /home; diff -r /home /tmp/home
  41. Figure out a way to count the total number of RPM packages installed on your machine.
  42. rpm -qa | wc -l
  43. Generate an alphabetized list of the installed RPM packages on your machine.
  44. rpm -qa | sort
  45. To what package does the '/usr/bin/time' command belong?
  46. rpm -qf /usr/bin/time
    [ answer is time-1.7-25 ]