pam_nologin

=Prevent non-root users from login= Main Menu

pam_nologin
The **pam_nologin** is a module that prevents users from logging into the system when /etc/nologin exists. The contents of the /etc/nologin file are displayed to the user. The pam_nologin module has no effect on the root user's ability to log in.

Options
Use this file instead the default /etc/nologin.**successok** Return PAM_SUCCESS if no file exists, the default is PAM_IGNORE.
 * file=**///path/nologin//

Original system-auth file:



 * Custom nologin file**
 * Create a file that contains a message that will be displayed to the non-root user when the pam_nologin module is configured.



Updated Configuration

 * To restrict access to the system I will implement the pam_nologin module.
 * The first step is to verify that the pam_nologin.so file exists in the /lib/security directory
 * The next step is to modify the /etc/pam.d/system-auth file.

Modified system-auth file:



 * I will attempt to login the system as //halletd//