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
- A. The use of the pam_block module along with the /etc/login configuration file.
- B. The use of the pam_deny module along with the /etc/deny configuration file.
- C. The use of the pam_pwdb module along with the /etc/pwdv.conf configuration file.
- D. The use of the pam_nologin module along with the /etc/nologin configuration file.
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.