Courseiva
SecuritymediumMultiple ChoiceObjective-mapped

XK0-006 Security Practice Question

An administrator needs to prevent a specific user 'bob' from logging in via SSH while allowing other users. Which configuration directive should be added to /etc/ssh/sshd_config?

⚠ Common exam trap

The trap is that candidates may choose AllowUsers with a whitelist (like option A) thinking it blocks bob, but it also blocks all other users not in the list. The question's requirement to 'prevent bob while allowing other users' is best met by a blacklist approach using DenyUsers. This tests understanding of whitelist vs. blacklist logic.

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

DenyUsers bob

The DenyUsers directive in /etc/ssh/sshd_config explicitly blocks specific usernames from logging in via SSH. By specifying 'DenyUsers bob', only user bob is denied, while all other users remain allowed. This matches the requirement to prevent bob without affecting others. AllowUsers with a whitelist would also block bob but would require listing every other user, which is impractical and not the intended solution.

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 alice charlie

    Why it's wrong here

    Incorrect. AllowUsers alice charlie would block bob, but it would also block all other users except alice and charlie, violating the requirement to allow other users.

  • PermitRootLogin no

    Why it's wrong here

    Incorrect. PermitRootLogin controls root SSH access, not a specific user like bob.

  • DenyUsers bob

    Why this is correct

    Correct. DenyUsers bob blocks only bob from SSH login, leaving all other users unaffected.

  • AllowUsers bob

    Why it's wrong here

    Incorrect. AllowUsers bob would permit only bob and block everyone else, which is the opposite of the requirement.

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.