Project 7 - User Accounts and Groups

In this lab, you will create and manage user accounts, and practice common services required to administer users on a UNIX/Linux computer. These activities include:

  1. Creating Groups
  2. Creating User Accounts
  3. Resetting a forgotten password
  4. Modifying a user's uid or gid
  5. Locking an account
  6. Customizing a login environment
  7. Deleting a user Account

Creating Groups

Create four new groups for your computer with the following GIDs:

  1. hobbits 1600
  2. elves 1700
  3. dwarves 1800
  4. wizards 1900

Creating User Accounts

Create five new user accounts using the following names and values:

  1. cis191 UID=1201 (with their own private group GID=1201) Full name: CIS191 (Add this account to the wizards group)
  2. frodo UID=1601 GID=1600 Full name: Frodo Baggins
  3. gollum UID=1602 GID=1600 Full name: Smeagol
  4. legolas UID=1701 GID=1700 Full name: Legolas of Mirkwood
  5. gimli UID=1801 GID=1800 Full name: Gimli son of Gloin

The password for all of the above accounts should be Cabri11o. Do not create private groups, but do take in the following considerations:

  1. Gollum wants his home directory to be named smeagol
  2. All home directories should be created in the /home directory.
  3. Legolas wants his shell to be tcsh
  4. Gimli doesn't want to have a password. (If you can grant his wish, do so.)

Be sure you can login to each account.

Resetting a forgotten password

Frodo forgot his password. You must reset it to Baggins and force him to change it the next time he logs in.

Modifying a user's name/identity

  1. Change Frodo's GID to be the users group, but make sure he retains his membership in the hobbit group.
  2. Legolas wants his username changed to glorfindel
  3. Gimli needs his UID changed to 1800. (Make certain that Gimli can still log in and access and create files after this change has been made.

Locking an Account

Glorfindel (a.k.a. Legolas) has been engaged in suspicious activity. You must lock his account.

Customizing a login environment

  1. Edit the /etc/issue file so that the first line says “Middle Earth Linux 1.0.”.
  2. Edit the /etc/motd file to include an announcement that this class is CIS 191B and that all activity on this computer is closely monitored.
  3. Gimli is confused by all the messages that come to the screen when he logs on. Configure his account so that no messages are displayed on the screen when he logs in. Hint: search for hush login using Google.

Deleting a user Account

Gollum has passed away, and his account must be removed. However, do not remove his home directory until you archive it to the /var/preserve directory and name it gollum.tar.

Turn In

Run the program, glab6 until you are satisfied with the results. Save the results by redirecting to a file called lab6 and submit the file on Canvas. You must fetch the glab6 script from opus like this:

wget http://opus.cis.cabrillo.edu/cis191/glab6

Be sure to make it executable before you run it and it must be run as root.