Go to main content

Securing Systems and Attached Devices in Oracle® Solaris 11.4

Exit Print View

Updated: July 2019
 
 

How to Temporarily Disable User Logins

Temporarily disable user logins during system shutdown or routine maintenance.


Note -  This procedure does not affect all users. The following can continue to log in to the system despite the presence of the /etc/nologin file created by this procedure.
  • Superuser

  • Users who are assigned the root role

  • Users who are assigned the solaris.system.maintenance authorization


For more information, see the nologin(5) man page.

Before You Begin

You must become an administrator who is assigned the solaris.admin.edit/etc/nologin authorization. By default, the root role has this authorization. For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.

  1. Create the /etc/nologin file in a text editor.
    # pfedit /etc/nologin

    For an example of using the solaris.admin.edit/etc/nologin authorization, see Example 8, Disabling User Logins.

  2. Include a message about system availability.
  3. Close and save the file.
Example 8  Disabling User Logins

In this example, a user is authorized to write the notification of system unavailability.

$ pfedit /etc/nologin
***No logins permitted.***

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