📝 Linux Exercise: User and Group Management
🎯 Objective
Students will practice creating and managing users and groups in Linux.
They will document (protocol) every command they executed and the output they received.
🔨 Task Instructions
1. Create two new users
- Create a user
alicewith a home directory. - Create a user
bobwith a home directory. - Set a password for both users.
💡 Commands to use: useradd, passwd
2. Create a new group
- Create a group called
students.
💡 Command to use: groupadd
3. Add users to groups
- Add both
aliceandbobto thestudentsgroup as supplementary members. - Change
alice’s primary group tostudents.
💡 Commands to use: usermod -aG, usermod -g
4. Check group memberships
- Show which groups
alicebelongs to. - Show which groups
bobbelongs to.
💡 Commands to use: groups, id
5. Modify a user account
- Rename
bobtorobert. - Change
robert’s home directory to/home/robert_home.
💡 Command to use: usermod
6. Delete a user
- Delete
alicecompletely, including her home directory.
💡 Command to use: userdel -r
7. Delete a group
- Delete the
studentsgroup.
💡 Command to use: groupdel
📑 Protocol (What to Hand In)
Each student should keep a protocol (log file or document) with:
- Every command they typed.
- The output they received.
- A short explanation (1–2 sentences) of what the command did.
Example format:
Command: sudo useradd -m alice
Output: (no output)
Explanation: Created user 'alice' with a home directory at /home/alice.✅ Completion Criteria
- All required users and groups were created, modified, and deleted.
- Protocol includes all commands, outputs, and explanations.
- Student can demonstrate understanding of primary group vs supplementary groups.