Courseiva
easyMultiple ChoiceObjective-mapped

XK0-006 Practice Question: A system administrator needs to restrict SSH…

A system administrator needs to restrict SSH access to a Linux server to only users in the 'sshusers' group. Which configuration change achieves this?

⚠ Common exam trap

CompTIA often tests the distinction between 'AllowUsers' (which expects usernames) and 'AllowGroups' (which expects group names), leading candidates to incorrectly choose 'AllowUsers sshusers' thinking it applies to the group rather than a user literal.

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

Add 'AllowGroups sshusers' to /etc/ssh/sshd_config

The 'AllowGroups' directive in /etc/ssh/sshd_config restricts SSH access to only users who are members of the specified group. When set to 'AllowGroups sshusers', only users belonging to the 'sshusers' group will be permitted to log in via SSH, effectively blocking all others. This is the standard method for group-based access control in OpenSSH.

Answer analysis

Option-by-option breakdown

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

  • Add 'DenyUsers *' to /etc/ssh/sshd_config

    Why it's wrong here

    DenyUsers * would block all users, not restrict to a group.

  • Set 'PermitRootLogin no' in /etc/ssh/sshd_config

    Why it's wrong here

    This only disables root login, not group-based access.

  • Add 'AllowGroups sshusers' to /etc/ssh/sshd_config

    Why this is correct

    AllowGroups restricts SSH access to members of the specified group.

  • Add 'AllowUsers sshusers' to /etc/ssh/sshd_config

    Why it's wrong here

    AllowUsers expects usernames, not group names.

About these practice questions

One of 979 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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.