CompTIA Linux+ (XK0-005) — Question 115

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?

Answer options

Correct answer: D

Explanation

The correct answer is D, pam_nologin.so, because this module specifically checks for the existence of the /etc/nologin file to restrict user logins. The other options, while related to authentication and access control, do not specifically address the functionality needed to restrict logins based on the presence of the /etc/nologin file.