mediumMultiple Choice
XK0-006 Practice Question: A systems administrator needs to restrict SSH…
A systems administrator needs to restrict SSH access to a Linux server so that only users in the 'sshusers' group can log in. Which configuration change should be made in /etc/ssh/sshd_config?
⚠ Common exam trap
Many exam-takers confuse 'AllowUsers' with 'AllowGroups', mistakenly thinking that 'AllowUsers sshusers' would restrict access to members of the 'sshusers' group, when in fact it only allows a user whose exact username is 'sshusers'.
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'
The 'AllowGroups' directive in /etc/ssh/sshd_config restricts SSH login to only users who are members of the specified group. By adding 'AllowGroups sshusers', only users in the 'sshusers' group will be permitted to authenticate via SSH, while all others are denied. This is the standard OpenSSH mechanism for group-based access control.
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 'AllowUsers sshusers'
Why it's wrong here
AllowUsers matches user account names, not group names, so 'sshusers' is treated as a username and no group member is permitted. It is tempting because AllowUsers is the correct directive for restricting SSH by user, and would be right if the requirement named individual accounts instead of a group.
- ✗
Add 'DenyGroups all'
Why it's wrong here
DenyGroups all blocks every group, including sshusers, so no group member can log in and the requirement fails entirely. It is tempting because DenyGroups is a genuine sshd_config directive for excluding groups, and would be correct if the goal were to bar specific unwanted groups while leaving others unrestricted.
- ✓
Add 'AllowGroups sshusers'
Why this is correct
AllowGroups restricts authentication to members of the named group, so only users in sshusers can log in. Other accounts, including valid ones outside the group, are denied at the SSH layer, satisfying the restriction requirement.
- ✗
Add 'PermitRootLogin no' and add users to sshusers
Why it's wrong here
PermitRootLogin no only stops direct root logins; it places no group restriction, so any non-root account can still authenticate over SSH. It is tempting because disabling root login is a standard SSH hardening step, and would be correct if the requirement were to prevent privileged direct access rather than limit logins to one group.
Go deeper
Related to this question
Learn chapter
User and Group Administration
Key term
Linux
Linux is an open-source operating system that manages computer hardware and software, widely used in servers, desktops, and embedded systems.
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 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.