A system administrator needs to modify sudo privileges for a user. Instead of using the recommended visudo command, they open /etc/sudoers directly with a standard text editor like nano or vi. They accidentally introduce a syntax error before saving and exiting the file. What is the most likely and immediate consequence of this action?
Only the user account being modified in the file will be unable to use sudo.
The system will ignore the line with the syntax error and apply all other valid rules.
The sudo command will become unusable for all users due to the parse error.
The system will automatically revert to the last known-good version of the sudoers file.
The correct answer is that the sudo command will become unusable for all users. The /etc/sudoers file is critical for the functioning of sudo. If sudo detects a syntax or parse error in this file, it will fail-safe and exit, preventing any user from elevating privileges. This is the primary reason the visudo command exists. visudo locks the sudoers file and performs a syntax check before saving, which prevents a malformed file from being written. The system will not revert to a previous configuration, nor will it ignore the single line with the error. The impact is global, affecting all users, not just the one being modified. The user's account will not be locked automatically as a result of this specific error.
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.
Why is the `visudo` command preferred over directly editing `/etc/sudoers`?
Open an interactive chat with Bash
What happens if the `/etc/sudoers` file has a syntax error?
Open an interactive chat with Bash
How can a syntax error in `/etc/sudoers` be fixed if `sudo` becomes unusable?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
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 .