XK0-006 Security Practice Question
An administrator wants to restrict SSH access to only users in the 'sshusers' group. Which configuration directive should be added to /etc/ssh/sshd_config?
⚠ Common exam trap
Test-takers frequently confuse AllowUsers with AllowGroups, or thinking Match Group restricts access when it only applies conditional settings.
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
✓
AllowGroups sshusers
The AllowGroups directive in /etc/ssh/sshd_config explicitly permits SSH login only for users who are members of the specified group(s). When AllowGroups sshusers is set, any user not in the 'sshusers' group is denied access, regardless of other settings. This is the correct and direct way to restrict SSH access to a specific group.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
AllowUsers sshusers
Why it's wrong here
AllowUsers matches login names, not group membership, so a user literally named sshusers would be permitted while actual group members are refused. AllowUsers is correct when restricting access to specific named accounts rather than an entire group.
- ✗
Match Group sshusers
Why it's wrong here
Match Group sshusers opens a conditional block but imposes no restriction by itself; without a following AllowGroups or DenyGroups directive inside it, access stays unchanged. Match blocks are correct for applying per-group settings such as ForceCommand or different authentication.
- ✓
AllowGroups sshusers
Why this is correct
AllowGroups restricts SSH logins to members of the named group, so only users in sshusers may authenticate. Unlike AllowUsers, which lists individual accounts, this directive scales by group membership, directly satisfying the requirement to limit access to that group.
- ✗
DenyGroups all
Why it's wrong here
DenyGroups all blocks every group, including sshusers, so no one gains SSH access. It is tempting as a blanket lockdown, and would be correct when the goal is to deny a specific group such as DenyGroups contractors while leaving others unaffected.
Go deeper
Related to this question
Learn chapter
Networking Fundamentals and Configuration
Key term
User
A user is any person, system, or device that interacts with an IT service, resource, or identity system, typically authenticated through credentials and authorized to perform specific actions.
Key term
SSH
SSH (Secure Shell) is a cryptographic network protocol that provides secure, encrypted communication and remote administration between two devices over an unsecured network.
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 →
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.