Courseiva
mediumMultiple ChoiceObjective-mapped

XK0-006 Practice Question: A security policy requires that SSH root login be…

A security policy requires that SSH root login be disabled, but key-based authentication for users should remain enabled. Which configuration line should be added to /etc/ssh/sshd_config?

⚠ Common exam trap

It's easy for candidates to confuse `PermitRootLogin no` (which blocks all root SSH access) with `PermitRootLogin prohibit-password` (which only blocks password-based root access), leading them to choose option B when the question explicitly requires key-based authentication to remain enabled.

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

PermitRootLogin prohibit-password

The directive `PermitRootLogin prohibit-password` in `/etc/ssh/sshd_config` disables password-based authentication for the root user while still allowing key-based authentication (e.g., SSH public key or GSSAPI). This satisfies the security policy requirement to disable root login via passwords but retain the ability for users (including root) to authenticate using SSH keys.

Answer analysis

Option-by-option breakdown

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

  • PermitEmptyPasswords no

    Why it's wrong here

    This prevents empty passwords but does not affect root login method.

  • PermitRootLogin no

    Why it's wrong here

    This disables all root logins, including key-based, which is more restrictive than needed.

  • PasswordAuthentication yes

    Why it's wrong here

    This enables password authentication for all users, including root, which contradicts the policy.

  • PermitRootLogin prohibit-password

    Why this is correct

    This disables password authentication for root while allowing key-based login.

About these practice questions

One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.