exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 81 discussion

Actual exam question from CompTIA's XK0-005
Question #: 81
Topic #: 1
[All XK0-005 Questions]

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
  • B. test -f /etc/sudoers
  • C. sudo vi check
  • D. cat /etc/sudoers | tee test
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Alizadeh
8 months, 3 weeks ago
Selected Answer: A
The correct answer is A. visudo -c.
upvoted 3 times
...
linux_admin
1 year, 2 months ago
Selected Answer: A
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.
upvoted 4 times
linux_admin
1 year, 2 months ago
sudo visudo -c /etc/sudoers: parsed OK /etc/sudoers.d/README: parsed OK /etc/sudoers.d/kali-grant-root: parsed OK
upvoted 2 times
...
...
Ckl22
1 year, 4 months ago
Selected Answer: C
C is the correct answer
upvoted 1 times
Ckl22
1 year, 4 months ago
Aamm033 is right, its A.
upvoted 2 times
...
...
Aamm033
1 year, 6 months ago
Selected Answer: A
-c flag is to check-only mode
upvoted 4 times
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago