Courseiva

XK0-006 Services and User Management Practice Question

A Linux administrator needs to configure sudo so that members of the group 'webadmins' can run any command as any user without being prompted for a password, but only on the host 'web01'. Which entry should be added to the sudoers file?

⚠ Common exam trap

The trap here is forgetting the % prefix for groups in sudoers or misplacing the host field, which could grant broader access than intended.

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

✓

%webadmins web01=(ALL) NOPASSWD: ALL

The sudoers syntax allows specifying a group with %, a host, a runas list, and commands. The entry %webadmins web01=(ALL) NOPASSWD: ALL correctly allows group members to run any command as any user on web01 without a password prompt. This is the precise configuration needed.

Answer analysis

Option-by-option breakdown

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

  • ✗

    %webadmins ALL=(ALL) NOPASSWD: ALL

    Why it's wrong here

    This entry grants passwordless sudo to the group on all hosts (ALL), not just web01. The host field is set to ALL, which violates the requirement to restrict access to the specific host web01. This is overly permissive.

  • ✓

    %webadmins web01=(ALL) NOPASSWD: ALL

    Why this is correct

    This entry grants the group webadmins (denoted by %) passwordless sudo access to run any command as any user on the host web01. The syntax is correct: user/group, host, runas, and command with NOPASSWD tag. It precisely matches the requirement.

  • ✗

    webadmins web01=(ALL) NOPASSWD: ALL

    Why it's wrong here

    Without the percent sign, webadmins is interpreted as a username, not a group. This would fail to grant access to group members. The % prefix is required to indicate a group in sudoers, so this entry does not meet the requirement.

  • ✗

    %webadmins web01=(root) NOPASSWD: /usr/bin/apt

    Why it's wrong here

    This entry restricts the group to running only /usr/bin/apt as root, not any command. The requirement is to allow any command as any user, so this is too restrictive and does not fulfill the stated need.

About these practice questions

Courseiva writes every XK0-006 question from scratch — 781 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.