System Administration Guide: Security Services

Temporarily Disabling User Logins

You can temporarily disable user logins by doing either of the following:

Creating the /etc/nologin File

Create this file to disallow user logins and notify users when a system will be unavailable for an extended period of time because of a system shutdown or routine maintenance.

If a user attempts to log in to a system where this file exists, the contents of the nologin file is displayed, and the user login is terminated. Superuser logins are not affected. For more information, see the nologin(4) man page.

How to Temporarily Disable User Logins

  1. Become superuser or assume an equivalent role.

  2. Create the /etc/nologin file by using an editor.


    # vi /etc/nologin
    
  3. Include a message about system availability.

  4. Close and save the file.

Example—Disabling User Logins

This example shows how to notify users of system unavailability.


# vi /etc/nologin
(Add system message here)
 
# cat /etc/nologin 
***No logins permitted.***

***The system will be unavailable until 12 noon.***