User Management Flashcards
7 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 User Management flashcards as text
What is the effect of setting a user's shell to `/sbin/nologin`?
Answer: Prevents the user from getting an interactive login shell
/sbin/nologin is a placeholder shell that prints a message and exits, preventing interactive logins while allowing other service authentications.
Which command shows the password aging information for a user named 'carol'?
Answer: chage -l carol
chage -l displays password aging details including last change, expiry, and warning dates for the specified user.
When using `visudo`, what is the correct syntax to allow user 'dave' to run all commands as root without a password?
Answer: dave ALL=(ALL) NOPASSWD: ALL
The NOPASSWD: keyword in the sudoers rule skips password prompting for the specified commands.
What does the `pwck` command do?
Answer: Verifies the integrity of /etc/passwd and /etc/shadow files
pwck validates /etc/passwd and /etc/shadow for consistency, detecting duplicate UIDs, missing home directories, and format errors.
Which command would delete the group 'contractors' from the system?
Answer: groupdel contractors
groupdel removes the specified group from /etc/group and /etc/gshadow.
What is the minimum number of days between password changes controlled by in /etc/shadow?
Answer: Field 4 — minimum password age
The fourth field in /etc/shadow sets the minimum number of days a user must wait before changing their password again.
A system administrator wants to list all users currently logged into the system. Which command provides this?
Answer: who
The `who` command shows all users currently logged in, including their terminal and login time.