A security audit requires the service account named "backup" to be prevented from interactive, password-based logins without affecting its scheduled cron jobs. The administrator issues the command:
# passwd -l backup
Which statement correctly describes the resulting change to the account's entry in /etc/shadow and the practical impact of that change?
The seventh field (password inactivity period) is set to 0, immediately disabling all forms of login and preventing any cron job from running under that account.
The entire line for the backup account is removed from /etc/shadow, effectively deleting the account while leaving its UID available for already-running processes.
An exclamation mark (!) is prefixed to the existing hash in the password field, which locks password authentication for the account while still allowing non-password methods such as SSH key authentication or execution by cron.
The third field is replaced with a value of 0, forcing the user to choose a new password at the next login but otherwise leaving the account fully usable.
The passwd -l (lock) option works by inserting an exclamation mark (!) at the start of the encrypted password in the second field of the user's /etc/shadow entry. Because the character is not part of any valid crypt(3) hash, PAM treats the password as invalid and refuses password-based authentication. The rest of the shadow fields-including UID, cron permissions, and other authentication mechanisms-remain unchanged, so scheduled tasks or key-based access continue to function. No other fields are modified, the account line is not deleted, and setting field values such as 0 in the last-change or inactivity columns is not part of this operation.
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 purpose of the /etc/shadow file?
Open an interactive chat with Bash
Why does adding an exclamation mark (!) to the password hash lock the account's password?
Open an interactive chat with Bash
How does locking an account with passwd -l affect scheduled cron jobs?
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 .