A system administrator needs to temporarily disable password-based login for a user account named temp_user without deleting the user or their current password. The administrator wants to be able to easily re-enable login later. Which of the following commands will accomplish this?
The correct command is passwd -l temp_user. The -l option locks the specified user's password by prepending an exclamation mark (!) to the encrypted password hash in the /etc/shadow file. This action prevents the user from authenticating with their password. The -u option is used to unlock an account that was previously locked with -l. The -d option deletes the user's password, which is a different action from locking it. The -e option expires the user's password, forcing them to change it at the next login, but it does not lock the account.
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 happens to the `/etc/shadow` file when a user's password is locked with `passwd -l`?
Open an interactive chat with Bash
How is unlocking an account with `passwd -u` different from deleting a password with `passwd -d`?
Open an interactive chat with Bash
What is the purpose of `passwd -e`, and how does it differ from `passwd -l`?
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 .