Courseiva
Security Engineering →mediumMultiple Choice

CAS-004 Security Engineering Practice Question

A security engineer is configuring a Linux web server that hosts a public-facing application. The server's SSH daemon must be hardened to prevent brute-force attacks and unauthorized access. The engineer has already disabled root login and password authentication. Which additional control should the engineer implement to restrict access to only authorized administrative users?

⚠ Common exam trap

The trap here is assuming that disabling root login and password authentication alone restricts SSH access to specific users.

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

✓

Configure AllowUsers in /etc/ssh/sshd_config to list authorized usernames.

The AllowUsers directive in sshd_config explicitly whitelists user accounts permitted to authenticate over SSH. When combined with disabled password authentication and no root login, it ensures only named administrative users can connect, directly satisfying the hardening goal. Other options either add authentication methods or obscure the service without limiting user access.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Enable ChallengeResponseAuthentication and configure PAM modules.

    Why it's wrong here

    ChallengeResponseAuthentication enables keyboard-interactive authentication, often used for one-time passwords or multi-factor. While it can add a layer of security, it does not restrict which users may log in. The requirement is to limit access to authorized administrative users, not to add an authentication method that could still allow any user with valid credentials.

  • ✓

    Configure AllowUsers in /etc/ssh/sshd_config to list authorized usernames.

    Why this is correct

    AllowUsers explicitly defines which user accounts may authenticate via SSH. When password authentication is disabled and root login is prohibited, this directive further narrows access to only the named administrative accounts. It directly addresses the requirement to restrict access to authorized users and is a standard hardening step for SSH daemons on public-facing servers.

  • ✗

    Set PermitRootLogin to no in /etc/ssh/sshd_config.

    Why it's wrong here

    PermitRootLogin no prevents direct root logins but does not restrict which non-root users can authenticate. The scenario states root login is already disabled, so this control is redundant. It does not limit access to a specific set of administrative users, leaving other accounts potentially able to connect via SSH if they have valid credentials or keys.

  • ✗

    Change the SSH port from 22 to a non-standard port.

    Why it's wrong here

    Changing the SSH port reduces automated scanning and brute-force attempts but is security through obscurity. It does not restrict access to specific users. An attacker who discovers the new port can still attempt to authenticate with any valid account. This control fails to meet the explicit requirement of limiting access to authorized administrative users.

About these practice questions

Courseiva writes every CAS-005 question from scratch — 973 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 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 CAS-005 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 CAS-005 exam.