XK0-006 Security Practice Question
A junior administrator needs to check whether a user account named 'bob' is locked and view the password aging information. Which command should be used?
⚠ Common exam trap
The trap here is choosing chage for lock status because it also deals with passwords, but chage shows aging only and never reports whether the account is locked.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
passwd -S bob
The passwd -S command reports the password status for a user, indicating locked, no password, or usable states, and includes aging data. This single command lets the administrator verify lock status and review password aging, which matches the scenario's need for inspection without modifying the account.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
passwd -S bob
Why this is correct
passwd -S displays the status of a user's password, including whether the account is locked (L), has no password (NP), or has a usable password (P), along with aging fields. This directly answers whether bob is locked and shows password aging details, making it the appropriate command for the administrator's check.
- ✗
usermod -L bob
Why it's wrong here
usermod -L locks the account by prepending an exclamation mark to the password hash, but it does not report status. Running it would change the system state rather than inspect it. The administrator wants to check whether bob is already locked and view aging info, so a modifying command is inappropriate and could cause unintended changes.
- ✗
chage -l bob
Why it's wrong here
chage -l lists password aging information such as last change, expiration, and minimum/maximum days, but it does not report whether the account is locked. A locked account may still show aging data, so this command alone cannot confirm lock status. The administrator specifically needs to verify locking, which chage does not provide.
- ✗
id bob
Why it's wrong here
id displays user identity information such as UID, GID, and group memberships. It does not show password status or aging fields. While useful for confirming that the account exists, it cannot tell the administrator whether the password is locked or when it expires, so it does not meet the requirement.
Go deeper
Related to this question
Learn chapter
User and Group Administration
Key term
passwd
passwd is a command-line utility used on Linux and Unix-like systems to change a user's password, typically stored in an encrypted format in the /etc/shadow file.
Key term
User
A user is any person, system, or device that interacts with an IT service, resource, or identity system, typically authenticated through credentials and authorized to perform specific actions.
About these practice questions
This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.