A systems administrator is tasked with preventing logins from accounts other than root, while the file /etc
/nologin exists. Which of the following PAM modules will accomplish this task?
Correct Answer: D
The PAM module pam_nologin.so will prevent logins from accounts other than root, while the file /etc
/nologin exists. This module checks for the existence of the file /etc/nologin and displays its contents to the user before denying access. The root user is exempt from this check and can still log in. This is the correct module to accomplish the task. The other options are incorrect because they are either non-existent modules (pam_login.so or pam_logindef.so) or do not perform the required function (pam_access.so controls access based on host, user, or time). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter
15: Managing Users and Groups, page 471.