CNT5605 - 2017 Summer
Assignment 8
Journals Due Sunday, July 23 at 11:59pm on Blackboard

Assignment: Users

  1. You have received a new batch of distinguished users; their basic information is located in newusers.tar. Inside of the tar file, there is a file called "newusers.txt" which contains a colon-separated entry for each user: the username, the uid, the GECOS information, and the user's preferred shell. Also in the tar file you will find a public key for each of these users in the subdirectory pubkeys/.
  2. Please add a test user to the newusers.txt with a public key for whom you also have the corresponding private key (i.e., use "ssh-keygen" to create a new key pair.)
  3. Please add these users to your Debian machine as local users (you might want to verify that no name clashes occur, though, before you proceed!) You must write a program to do this addition; do not add these users by hand. Your program should create home directories on your Debian box with the usual files from /etc/skel, but put the home directories in /home/users/USERNAME/, not just /home/USERNAME. Each user should have his own group, where the group id matches the user id. Don't assign passwords to these accounts; instead, set it up so that the users can login using the public key provided in the tar file.
  4. Also, create a /scratch/USERNAME/ directory for each user, and make sure that it is owned by the correct user and has the correct group number.
  5. Finally, after you have installed these users with your program, verify that you can ssh into the test user's account, and test that all permissions and directories are set up correctly for that user.

My advice for the program is to use a scripting language; most people find using /bin/bash adequate, though writing this program in Python or Perl (or Lua, or C, or Gauche, or Racket, or Clojure, or AWK, or ...) is more pleasant.

(The hardest language — by far — would be assembly language, if you are looking for a challenge.)

A journal is due for this assignment. Make sure that you document in your journal all of the steps that you went through, following the guidelines on the class home page. Please submit your journal on Blackboard by 11:59pm on Sunday, July 23. You must include a copy of your script in the write-up.