Introduction
In this challenge, you will apply your knowledge of Linux user account management. You'll create new user accounts, modify existing ones, and delete users. This challenge will test your understanding of the concepts learned in the "User Account Management" lab.
Achievements
You'll demonstrate your ability to use:
useradd- to create new userspasswd- to change user passwordsusermod- to modify user accountsuserdel- to delete user accounts
Creating User Accounts
In this step, you'll create several user accounts with different specifications.
Tasks
Complete the following tasks in order:
- Create a user named
joker. - Create a user named
batmanwith a home directory at/home/gotham.
Requirements
- Use the
useraddcommand for all user creations. - Ensure both users have home directories created during account creation.
batmanhas a different home directory than the default.
Example
After completing these tasks, you can verify the user information like this:
grep -w joker /etc/passwd
grep -w batman /etc/passwd
Sample output:
joker:x:5001:5001::/home/joker:/bin/sh
batman:x:5002:5002::/home/gotham:/bin/sh
Managing User Passwords
In this step, you'll set and change passwords for users.
Tasks
Complete the following tasks:
- Set a password for the
jokeruser. - Set a password for the
batmanuser.
Requirements
- Use the
passwdcommand for all password operations. - For this challenge, use simple passwords like
password123.
Example
After setting the passwords, you can check the password status:
sudo passwd -S joker
sudo passwd -S batman
Sample output:
joker P 01/19/2024 0 99999 7 -1
batman P 01/19/2024 0 99999 7 -1
In this output, P means the account has a usable password.
Modifying User Accounts
In this step, you'll modify existing user accounts.
Tasks
Complete the following tasks:
- Change the
jokeruser's home directory to/home/arkham. - Change the
batmanuser's shell to/bin/bash.
Requirements
- Use the
usermodcommand for all modifications.
Example
After making these changes, you can verify them:
grep -w joker /etc/passwd
grep -w batman /etc/passwd
Sample output:
joker:x:5001:5001::/home/arkham:/bin/sh
batman:x:5002:5002::/home/gotham:/bin/bash
Deleting User Accounts
In this final step, you'll delete user accounts.
Tasks
Complete the following tasks:
- Delete the
jokeruser without removing their home directory. - Delete the
batmanuser and their home directory/home/gotham.
Requirements
- Use the
userdelcommand for all deletions.
Example
After deleting these users, you can verify:
grep -w joker /etc/passwd
grep -w batman /etc/passwd
ls -ld /home/gotham
The two grep commands should return no results. For ls -ld /home/gotham, a "No such file or directory" message confirms the directory was removed.
Summary
Congratulations! You've completed the "Joker's Trick" user account management challenge. You've demonstrated your ability to:
- Create user accounts with various specifications
- Set and change user passwords
- Modify user account properties
- Delete user accounts with and without removing home directories
These skills are fundamental for Linux system administration. Keep practicing and exploring to become a Linux user management expert!



