Linux Exercise 1 - User and Group Management
📝 Linux Exercise: User and Group Management
Section titled “📝 Linux Exercise: User and Group Management”🎯 Objective
Section titled “🎯 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
Section titled “🔨 Task Instructions”1. Create two new users
Section titled “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
Section titled “2. Create a new group”- Create a group called
students.
💡 Command to use: groupadd
3. Add users to groups
Section titled “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
Section titled “4. Check group memberships”- Show which groups
alicebelongs to. - Show which groups
bobbelongs to.
💡 Commands to use: groups, id
5. Modify a user account
Section titled “5. Modify a user account”- Rename
bobtorobert. - Change
robert’s home directory to/home/robert_home.
💡 Command to use: usermod
6. Delete a user
Section titled “6. Delete a user”- Delete
alicecompletely, including her home directory.
💡 Command to use: userdel -r
7. Delete a group
Section titled “7. Delete a group”- Delete the
studentsgroup.
💡 Command to use: groupdel
📑 Protocol (What to Hand In)
Section titled “📑 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 aliceOutput: (no output)Explanation: Created user 'alice' with a home directory at /home/alice.✅ Completion Criteria
Section titled “✅ 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.