LPIC-2 System Security Practice Question
Exhibit
# /etc/pam.d/sshd auth required pam_securetty.so auth required pam_unix.so nullok auth required pam_nologin.so account required pam_unix.so password required pam_unix.so session required pam_unix.so
Refer to the exhibit. A user cannot log in via SSH even though the password is correct. What is the most likely issue?
⚠ Common exam trap
The trap here is that candidates often focus on password-related PAM modules (like pam_unix.so or pam_securetty.so) and overlook the system-level /etc/nologin file, which can silently block all non-root logins regardless of authentication success.
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
✓
The /etc/nologin file exists, preventing non-root logins.
The /etc/nologin file, when present, prevents all non-root users from logging into the system via any authentication method, including SSH. This is a common administrative mechanism to block user access during maintenance or security incidents. Since the password is correct but login fails, the existence of /etc/nologin is the most likely cause, as it overrides successful PAM authentication for non-root users.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The password module is not configured correctly.
Why it's wrong here
The password module is present; the issue is likely with authentication.
- ✗
pam_unix.so nullok allows blank passwords, causing authentication to fail.
Why it's wrong here
nullok allows null passwords, but the password is correct.
- ✓
The /etc/nologin file exists, preventing non-root logins.
Why this is correct
pam_nologin.so denies login if /etc/nologin exists, affecting all users except root.
- ✗
pam_securetty.so restricts root login via SSH, but the user is not root.
Why it's wrong here
pam_securetty only affects root, not regular users.
Go deeper
Related to this question
About these practice questions
This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.