LPIC-2 Exam 202 (Linux Engineer) — Question 119

Select the alternative that shows the correct way to disable a user login for all users except root.

Answer options

Correct answer: D

Explanation

The correct answer is D because the pam_nologin module restricts user logins while allowing root access when the /etc/nologin file is present. Options A, B, and C are incorrect as they do not serve the purpose of disabling user logins while allowing root access in the specified manner.