Bird
Raised Fist0
Linux CLIscripting~20 mins

Why user management secures systems in Linux CLI - Challenge Your Understanding

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
User Management Security Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why does limiting user permissions improve system security?
Imagine a shared computer where everyone can install any software they want. What is the main reason limiting user permissions helps keep the system safe?
AIt allows users to share files more easily with each other.
BIt prevents users from accidentally or intentionally changing important system files.
CIt makes the computer run faster by reducing user activity.
DIt increases the number of users who can log in at the same time.
Attempts:
2 left
💡 Hint
Think about what could happen if everyone could change system files.
💻 Command Output
intermediate
1:00remaining
What is the output of the user listing command?
You run the command cut -d: -f1 /etc/passwd on a Linux system. What does this command output?
Linux CLI
cut -d: -f1 /etc/passwd
AThe current logged-in user's home directory.
BA list of all user passwords in plain text.
CA list of all usernames on the system.
DThe system's hostname.
Attempts:
2 left
💡 Hint
The /etc/passwd file stores user account information separated by colons.
📝 Syntax
advanced
1:30remaining
Which command correctly adds a new user with a home directory?
You want to add a new user named 'alex' and create a home directory for them. Which command is correct?
Auseradd alex --create-home-dir
Badduser -d alex
Cadduser alex -home
Duseradd -m alex
Attempts:
2 left
💡 Hint
The '-m' option creates a home directory with useradd.
🔧 Debug
advanced
1:30remaining
Why does this user deletion command fail?
You run userdel alex but the user's home directory remains. Why?
Linux CLI
userdel alex
ABecause the command does not delete the user's home directory by default.
BBecause the user's processes are still running.
CBecause the command requires root privileges to run.
DBecause the user 'alex' does not exist.
Attempts:
2 left
💡 Hint
Check the command options for deleting home directories.
🚀 Application
expert
2:00remaining
How to securely allow a user to run a specific command as root?
You want to let user 'jane' run only the command systemctl restart apache2 with root privileges without giving full root access. Which approach is best?
AAdd a sudoers rule allowing 'jane' to run only 'systemctl restart apache2'.
BAdd 'jane' to the root group.
CGive 'jane' the root password.
DCreate a cron job that runs the command as root.
Attempts:
2 left
💡 Hint
Sudoers file controls specific command permissions.

Practice

(1/5)
1. Why is user management important for system security?
easy
A. It updates software without user permission
B. It controls who can access the system and what they can do
C. It cleans temporary files automatically
D. It speeds up the computer's processing power

Solution

  1. Step 1: Understand user management purpose

    User management sets permissions and access rights for users.
  2. Step 2: Connect user control to security

    By controlling access, it prevents unauthorized changes and protects data.
  3. Final Answer:

    It controls who can access the system and what they can do -> Option B
  4. Quick Check:

    User access control = security [OK]
Hint: User management controls access rights to secure system [OK]
Common Mistakes:
  • Confusing user management with system speed
  • Thinking it cleans files automatically
  • Believing it updates software silently
2. Which command is used to add a new user in Linux?
easy
A. useradd
B. adduserlist
C. createuser
D. newuser

Solution

  1. Step 1: Recall Linux user creation commands

    The standard command to add a user is useradd.
  2. Step 2: Verify other options

    Other options are not valid Linux commands for adding users.
  3. Final Answer:

    useradd -> Option A
  4. Quick Check:

    Linux add user = useradd [OK]
Hint: Use 'useradd' to add users in Linux [OK]
Common Mistakes:
  • Using non-existent commands like 'newuser'
  • Confusing 'adduserlist' with 'useradd'
  • Trying 'createuser' which is not standard
3. What will be the output of the command id alice if user 'alice' exists with UID 1001 and belongs to groups 'users' and 'admin'?
medium
A. uid=1001(alice) gid=1001(alice) groups=1001(alice),1002(admin)
B. uid=1001(alice) gid=100(users) groups=100(users),101(admin)
C. uid=1001(alice) gid=1001(alice) groups=1001(alice),1002(users),1003(admin)
D. uid=1001(alice) gid=1001(alice) groups=1001(alice),1002(admin),1003(users)

Solution

  1. Step 1: Understand id command output

    The id command shows user ID (uid), group ID (gid), and groups with their IDs.
  2. Step 2: Match given user and groups

    User 'alice' has UID 1001 and belongs to groups 'users' and 'admin'. The gid usually matches the user's primary group, here 1001(alice). Groups listed include primary and secondary groups with their IDs.
  3. Final Answer:

    uid=1001(alice) gid=1001(alice) groups=1001(alice),1002(users),1003(admin) -> Option C
  4. Quick Check:

    id shows uid, gid, groups = uid=1001(alice) gid=1001(alice) groups=1001(alice),1002(users),1003(admin) [OK]
Hint: id command shows user and group IDs clearly [OK]
Common Mistakes:
  • Mixing group IDs and names incorrectly
  • Assuming gid is 'users' instead of user's primary group
  • Adding extra groups not specified
4. You tried to add a user with useradd bob but got an error 'useradd: command not found'. What is the likely cause?
medium
A. The username 'bob' is already taken
B. You typed the command incorrectly; it should be 'adduser bob'
C. The system does not support user accounts
D. You need to run the command as root or with sudo

Solution

  1. Step 1: Analyze the error message

    'command not found' means the shell cannot find the useradd command in your path or permission is denied.
  2. Step 2: Check permissions and command availability

    Adding users requires root privileges; running without sudo or root causes this error.
  3. Final Answer:

    You need to run the command as root or with sudo -> Option D
  4. Quick Check:

    Permission needed for useradd = You need to run the command as root or with sudo [OK]
Hint: Use sudo before useradd to avoid permission errors [OK]
Common Mistakes:
  • Assuming username conflict causes 'command not found'
  • Thinking system lacks user accounts
  • Confusing 'useradd' with 'adduser' command
5. You want to secure a system by limiting user access. Which approach best uses user management to achieve this?
hard
A. Create separate user accounts with minimal permissions and use groups to control access
B. Allow all users to share one admin account for convenience
C. Disable user accounts and only use root for all tasks
D. Remove all users except guest to simplify management

Solution

  1. Step 1: Understand security best practices

    Limiting user permissions and using groups helps control who can do what on the system.
  2. Step 2: Evaluate options for security

    Sharing admin accounts or using root for all tasks is risky. Removing users excessively limits functionality.
  3. Final Answer:

    Create separate user accounts with minimal permissions and use groups to control access -> Option A
  4. Quick Check:

    Least privilege + groups = secure user management [OK]
Hint: Use minimal permissions and groups to secure users [OK]
Common Mistakes:
  • Sharing admin accounts weakens security
  • Using root for all tasks is unsafe
  • Removing users breaks system usability
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard