Courseiva
mediumMultiple ChoiceObjective-mapped

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 restricts by user, not group.

  • Add 'DenyGroups all'

    Why it's wrong here

    DenyGroups blocks groups, but does not explicitly allow sshusers.

  • Add 'AllowGroups sshusers'

    Why this is correct

    AllowGroups restricts SSH access to members of the specified group.

  • Add 'PermitRootLogin no' and add users to sshusers

    Why it's wrong here

    PermitRootLogin controls root access, not group-based access.

About these practice questions

Courseiva writes every XK0-006 question from scratch — 979 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 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.