LPIC-2 System Security Practice Question
Exhibit
Refer to the exhibit. # cat /etc/ssh/sshd_config | grep -v '^#' | grep -v '^$' Port 22 Protocol 2 PermitRootLogin no PubkeyAuthentication yes PasswordAuthentication no ChallengeResponseAuthentication no UsePAM yes AllowUsers alice bob DenyUsers charlie
Based on the sshd configuration, user 'charlie' attempts to log in using public key authentication. What will happen?
⚠ Common exam trap
Many candidates assume that enabling public key authentication automatically allows login, ignoring the explicit DenyUsers directive that takes precedence over authentication methods.
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
✓
Login is denied because the DenyUsers directive explicitly blocks charlie.
The DenyUsers directive in sshd_config explicitly blocks the user 'charlie' from logging in, regardless of the authentication method. Since DenyUsers takes precedence over AllowUsers and other authentication settings, public key authentication will still be denied for charlie. The correct answer is A because the directive explicitly denies charlie, overriding any other configuration.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Login is denied because the DenyUsers directive explicitly blocks charlie.
Why this is correct
DenyUsers blocks charlie regardless of authentication.
- ✗
Login is allowed because PasswordAuthentication is disabled, but public key authentication is enabled.
Why it's wrong here
DenyUsers applies to all authentication methods.
- ✗
Login is allowed because AllowUsers includes other users but does not deny charlie.
Why it's wrong here
DenyUsers explicitly denies charlie.
- ✗
Login is denied because charlie's IP address is not in the allowed list.
Why it's wrong here
No IP-based restrictions are configured.
Go deeper
Related to this question
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 →
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.