A systems administrator wants to be sure the sudo rules just added to /etc/sudoers are valid. Which of the following commands can be used for this task?
A. visudo -c
The visudo command is used to edit the /etc/sudoers file, and the -c option is used to check the syntax of the file without actually making any changes to it. If there are any syntax errors in the file, visudo will return an error message and prevent the changes from being saved. So, the command "visudo -c" can be used to validate the sudo rules in /etc/sudoers.
Option B "test -f /etc/sudoers" checks if the file /etc/sudoers exists, but it does not validate the syntax of the file.
Option C "sudo vi check" opens the file "check" with the vi editor, but it does not relate to the /etc/sudoers file.
Option D "cat /etc/sudoers | tee test" displays the contents of the /etc/sudoers file and saves it to a file named "test", but it does not validate the syntax of the file.
This section is not available anymore. Please use the main Exam Page.XK0-005 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Alizadeh
8 months, 3 weeks agolinux_admin
1 year, 2 months agolinux_admin
1 year, 2 months agoCkl22
1 year, 4 months agoCkl22
1 year, 4 months agoAamm033
1 year, 6 months ago