Assignment 4 – Group and User Management

Goal:
The goal of this lab is to familiarize students with the fundamental tasks of managing user
and group accounts in Linux. By completing this lab, students will gain practical experience
in creating, modifying, and deleting accounts, as well as managing group memberships
and permissions, which are essential skills in system administration and cybersecurity.
Submission Instructions:
• Complete all tasks in Task A and Task B on your chosen Ubuntu/Kali VM.
• Take screenshots for each step as evidence of successful command execution.
• Save all your screenshots and results in a single PDF or Word document.
• Ensure that all commands are executed correctly and include detailed explanations
for each step taken.

In this assignment, you should replace xxxxx with your MIDAS ID in all occurrences.
Task A – User Account management (8 * 5 = 40 points)
1. Open a terminal window in VM and execute the correct command to display user account
information (including the login shell and home directory) for the current user using grep.
2. Execute the correct command to display user password information (including the encrypted
password and password aging) for the current user using grep.
3. Create a new user named xxxxx and explicitly use options to create the home directory
/home/xxxxx for this user.
4. Set a password for the new user.
5. Set bash shell as the default login shell for the new user xxxxx, then verify the change.
6. Execute the correct command to display user password information (including the encrypted
password and password aging) for the new user xxxxx using grep.
7. Add the new user xxxxx to sudo group without overriding the existing group membership.
8. Switch to the new user’s account.
Task B – Group account management (12 * 5 = 60 points)
Use Linux commands to execute the following tasks:
1. Return to your home directory and determine the shell you are using.
2. Display the current user’s ID and group membership.
3. Display the group membership of the root account.
4. Run the correct command to determine the user owner and group owner of the /etc/group
file.
5. Create a new group named test and use your UIN as the GID.
6. Display the group account information for the test group using grep.
7. Change the group name of the test group to newtest.
8. Add the current account (xxxxx) as a secondary member of the newtest group without
overriding this user’s current group membership.
9. Create a new file testfile in the account’s home directory, then change the group owner to
newtest.
10. Display the user owner and group owner information of the file testfile.
11. Delete the newtest group, then repeat the previous step. What do you find?
12. Delete the user xxxxx along with the home directory using a single command

Reflection
This lab focused on managing user and group accounts. I learned how to create and manage user accounts, modify user attributes, and manage group memberships. I utilized commans such as grep, usermod, groupadd, chown, and chgrp to manage account information, files permissions and groups.

Leave a Reply

Your email address will not be published. Required fields are marked *