During a security investigation you must immediately disable password authentication for the local account "bob". Company policy forbids changing the user's login shell or expiration date, and the passwd utility is blocked, so you must use the usermod command. The solution must keep bob's current password hash so the account can be unlocked later and must only prevent password-based logins (bob's running processes and key-based access must continue to work). Which command satisfies these requirements?
The usermod option that locks only the password field is the upper-case -L switch. Running usermod -L bob inserts an exclamation mark in front of bob's existing hash in /etc/shadow, rendering every password invalid while preserving the original hash. Because no other attributes such as the shell or expiry date are touched, bob's running jobs continue and the account can be re-enabled with usermod -U bob.
Why the other choices are wrong:
usermod -l bob uses a lower-case letter and renames the login; it does not lock anything.
chage -E 0 bob sets the account's expiration date to the Unix epoch, fully disabling all logins, not just password authentication, and therefore exceeds the stated requirement.
usermod -s /usr/sbin/nologin bob changes the login shell; password authentication could still succeed (depending on PAM), and the action violates the policy forbidding shell changes.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the difference between `usermod -L` and `usermod -l`?
Open an interactive chat with Bash
What does the exclamation mark in `/etc/shadow` signify?
Open an interactive chat with Bash
Why is `chage -E 0 bob` not suitable for this scenario?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .