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?
The sudo command will become unusable for all users due to the parse error.
The system will ignore the line with the syntax error and apply all other valid rules.
The system will automatically revert to the last known-good version of the sudoers file.
Only the user account being modified in the file will be unable to use sudo.
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...
IT & Cybersecurity Package Join Premium for Full Access