CIS126RH  ·  Users & Groups

Managing Local
Users and Groups

Retrieval Practice Quiz  ·  Fill in the Blank

✏️  Close your notes.
⏎  Press Space or to advance.
💡  Try to answer before pressing Space again to reveal each answer.

Red Hat System Administration I  ·  Mesa Community College

Question 1 of 10

Identifying users

Every user account on a Linux system is assigned a unique number called a  , which the kernel uses to identify that user internally.

The kernel tracks users by this number, not by the username string.
Answer UID (User ID)

Question 2 of 10

The user database

The file that stores basic account information — including username, UID, home directory, and default shell — for every user on the system is  

World-readable. Try: cat /etc/______
Answer /etc/passwd

Question 3 of 10

Password storage

User password hashes are not stored in /etc/passwd. They are stored in the file  , which is readable only by root.

The name reflects that this file is kept out of the light.
Answer /etc/shadow

Question 4 of 10

Creating users

The command   creates the new user account megan .

Answer useradd megan

Question 5 of 10

Locking and unlocking

To lock a user account so the user cannot log in, you run usermod with the   option. To unlock it, you use  

Think of the first letters of the words Lock and Unlock.
Answer Lock: usermod -L username  ·  Unlock: usermod -U username

Question 6 of 10

Setting passwords

The   command is used to assign or change a user's password from the command line. Run as root, it can change any user's password.

Answer passwd  — e.g. passwd username

Question 7 of 10

File ownership

Every user belongs to a primary group. When a user creates a new file, the file's group ownership is set to the user's   group by default.

This is the GID stored in /etc/passwd for that user.
Answer primary group

Question 8 of 10

The group database

Group account information — including group name, GID, and member list — is stored in the file  

Answer /etc/group

Question 9 of 10

Adding to a group

The command   adds an existing user to a supplementary group without removing them from their other groups. The options used are  

Omitting the -a flag here would replace all existing group memberships — a common mistake.
Answer usermod -aG groupname username  — -a appends, -G specifies the supplementary group

Question 10 of 10

Gaining elevated privileges

A user can run a single command with root privileges by prefixing it with  . To open a full interactive root shell, a user with appropriate rights runs  

The second command opens a login shell as root, inheriting root's environment.
Answer Single command: sudo <command>  ·  Root shell: sudo -i

Bonus Extra credit

UID ranges

The range of UIDs reserved for regular (non-system) user accounts on RHEL begins at  

UIDs below this number are reserved for system accounts and daemons.
Answer 1000 — UIDs 0–999 are reserved for system accounts

Answer Key — Q1 to Q5

Quick Reference

Q1   UID (User ID)
Q2   /etc/passwd
Q3   /etc/shadow
Q4   useradd megan
Q5   -L lock · -U unlock

Answer Key — Q6 to Bonus

Quick Reference

Q6   passwd
Q7   primary group
Q8   /etc/group
Q9   usermod -aG
Q10   sudo · sudo -i
Bonus   UID 1000

CIS126RH — Managing Local Users and Groups  ·  Mesa Community College