Courseiva

XK0-006 Services and User Management Practice Question

A Linux administrator needs to allow members of the group 'developers' to run all commands as root without being prompted for a password, but only from the host 'build01'. The administrator adds the following line to /etc/sudoers: '%developers build01=(ALL) NOPASSWD: ALL'. After saving, users report that sudo still prompts for a password on build01. Which command should the administrator run to verify the syntax and placement of the rule?

⚠ Common exam trap

The trap here is assuming that listing a user's sudo privileges validates the sudoers file syntax, when only visudo -c performs that check.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

visudo -c

The correct command is visudo -c, which parses the sudoers file and reports syntax errors. Because the rule was added manually, a syntax mistake or misplacement could cause sudo to ignore it or fail. Validating with visudo -c ensures the file is well-formed before investigating effective privileges with sudo -l.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    visudo -c

    Why this is correct

    Running visudo -c checks the sudoers file for syntax errors and reports the parsed result, confirming whether the rule is syntactically valid. It does not enforce placement, but it will reveal if the line was inserted in a way that breaks parsing or if an earlier conflicting rule exists. This is the standard validation step before troubleshooting further.

  • ✗

    grep developers /etc/sudoers

    Why it's wrong here

    Searching for the group name only confirms the text exists; it does not check syntax or whether the line is in the correct section. A misplaced line could still be found by grep but be ineffective or cause a parse error. This does not satisfy the requirement to verify syntax and placement.

  • ✗

    sudo -l -U developer1

    Why it's wrong here

    Listing a user's sudo privileges shows the effective rules for that user, which is useful for confirming whether the NOPASSWD tag is applied. However, it does not validate the sudoers file syntax or placement; a syntax error would prevent sudo from running altogether. The question asks for syntax and placement verification, not effective privilege display.

  • ✗

    sudo -V

    Why it's wrong here

    The -V option displays the sudo version and compile-time options, not the contents or validity of the sudoers file. It provides no information about the rule's syntax or placement. This is a common distractor because administrators sometimes use it to check feature support, but it does not address the scenario.

About these practice questions

One of 781 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.