Courseiva
System SecurityhardMultiple ChoiceObjective-mapped

LPIC-2 System Security Practice Question

A security audit reveals that a server with PAM authentication allows users to log in even when the '/etc/nologin' file exists, contrary to policy. Which PAM module is most likely misconfigured or missing?

⚠ Common exam trap

Watch out — candidates often confuse pam_nologin.so with pam_securetty.so, assuming both restrict login based on a file, but pam_securetty.so only applies to root and /etc/securetty, not to general user access via /etc/nologin.

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

pam_nologin.so

The pam_nologin.so module is specifically designed to check for the existence of /etc/nologin and, if found, prevent non-root users from logging in. If users can still log in despite this file existing, the module is either missing from the PAM stack (e.g., not included in /etc/pam.d/login or /etc/pam.d/sshd) or misconfigured (e.g., placed after the authentication phase instead of the account phase).

Answer analysis

Option-by-option breakdown

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

  • pam_nologin.so

    Why this is correct

    Denies login if /etc/nologin exists.

  • pam_securetty.so

    Why it's wrong here

    Controls root TTY access, not /etc/nologin.

  • pam_access.so

    Why it's wrong here

    Controls access based on /etc/security/access.conf.

  • pam_lastlog.so

    Why it's wrong here

    Records last login time, no denial.

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 →

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.