CIT054 Index > Assignment: Adding Users

Assignment: Adding Users

You will do this assignment on the server.

The book tells you how to directly add and delete users by editing the passwd and shadow files. This is not a good way to do things. Instead, you will use the useradd and groupadd utilities.

In the following instructions, substitute your first name for name. You don’t need to create a password for a new user unless it is specifically requested in the instructions.

  1. Create a group whose name is the same as your first name.

  2. Create a user name1 (that’s a digit one at the end) whose comment field is your full name, and whose primary group is the group you created in the previous step. Create a home directory for that user. This is all done with one command.

  3. Create a user name2 whose primary group is the group you created in step one. This user will also belong to group users and games. Create a home directory for the user. Again, this can all be done with one command

  4. Create a directory named /etc/skel_name. Inside that directory, touch a file named homestuff.

  5. Create a user name3 whose primary group is the group you created in step one. Make a home directory based on the contents of /etc/skel_name.

  6. Create a user name4 whose primary group is the group you created in step one. Make a home directory for the user. Have the account expire one week from whatever the day is that you are doing this assignment.

  7. Create a user name5 whose primary group is the group you created in step one. Make a home directory for the user. Change the user’s password to secret (yes, that is a lousy password). Now set the password to have a maximum password lifetime be 30 days and the minimum 1 day. You will need to use the passwd command twice to do this.

When You Finish

Notify the instructor via email that you have finished the assignment.