Lab 1: User Management
Objective:
- To understand and practice user management tasks on a Linux system.
Topics Covered:
- Creating Users
- Modifying User Accounts
- Managing User Passwords
- Deleting User Accounts
- Understanding User Groups
- Group Management
Lab Exercises:
Exercise 1: Creating Users
- Create a new user account named
user1
. - Set an initial password for
user1
. - Verify the creation of the user account.
Exercise 2: Modifying User Accounts
- Modify the home directory of
user1
to/home/users/user1
. - Change the default shell for
user1
to/bin/bash
. - Verify the changes made to the user account.
Exercise 3: Managing User Passwords
- Force
user1
to change the password on the next login. - Set password aging for
user1
to expire in 30 days. - Verify the password-related changes.
Exercise 4: Deleting User Accounts
- Delete the user account
user1
. - Ensure that the home directory and files associated with
user1
are removed.
Exercise 5: Understanding User Groups
- Create a new group named
staff
. - Add
user1
to thestaff
group. - Verify the group membership of
user1
.
Exercise 6: Group Management
- Create a new user account named
user2
. - Assign both
user1
anduser2
to thestaff
group. - Remove
user2
from thestaff
group. - Delete the
staff
group.
Lab Documentation:
Provide detailed instructions for each exercise, including command syntax and expected outcomes. Include explanations of the purpose behind each task.
Tips:
- Explore additional user management commands (
usermod
,passwd
,chage
,groupadd
,userdel
, etc.).