A system administrator is tasked with granting a user named 'johndoe' the ability to run a backup script located at /usr/local/bin/backup.sh without entering a password. To achieve this securely while employing syntax validation, which of the following configurations should the administrator add to the sudoers file using an appropriate command?
The correct answer is 'johndoe ALL=(ALL) NOPASSWD: /usr/local/bin/backup.sh', and it should be added using the visudo command. This command specifically allows 'johndoe' to run the backup script without a password. The visudo command is used instead of direct file editing tools because it includes syntax checking to prevent errors that could render the sudoers file unusable or introduce security vulnerabilities. Other options listed either require a password, do not specify the script, grant broader permissions than required, or use incorrect syntax.
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 does the NOPASSWD option in the sudoers file do?
Open an interactive chat with Bash
What is the `visudo` command and why is it important?
Open an interactive chat with Bash
What are some common mistakes when configuring the sudoers file?