Courseiva
System SecurityeasyMultiple ChoiceObjective-mapped

LPIC-2 System Security Practice Question

A system administrator wants to ensure that only key-based authentication is allowed for SSH and password authentication is disabled. Which configuration change is required in /etc/ssh/sshd_config?

⚠ Common exam trap

Candidates often think disabling password authentication alone is sufficient (Option D), forgetting that explicitly enabling public key authentication is necessary to ensure key-based login works and to avoid ambiguity in environments where defaults may differ.

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

PasswordAuthentication no and PubkeyAuthentication yes

Setting `PasswordAuthentication no` disables password-based login, while `PubkeyAuthentication yes` enables public key authentication. Together, these directives ensure that only users with a valid SSH key pair can authenticate, meeting the requirement to disable password authentication entirely.

Answer analysis

Option-by-option breakdown

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

  • PasswordAuthentication yes and PubkeyAuthentication yes

    Why it's wrong here

    This allows both password and key authentication, not disabling passwords.

  • PasswordAuthentication no and PubkeyAuthentication no

    Why it's wrong here

    This disables all authentication methods, preventing any login.

  • PasswordAuthentication no and PubkeyAuthentication yes

    Why this is correct

    This disables password logins and enables key-based authentication, meeting the requirement.

  • PasswordAuthentication no

    Why it's wrong here

    Only disabling passwords is insufficient; key auth must be explicitly enabled.

About these practice questions

One of 507 original LPIC-2 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 LPIC-2 practice question is part of Courseiva's free LPI 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 LPIC-2 exam.