Go to main content

man pages section 5: File Formats

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

nologin(5)

Name

nologin - file to restrict logins to a system

Synopsis

/etc/nologin

Description

If the /etc/nologin file exists, it restricts logins to a system. After displaying the contents of the nologin file, the login procedure terminates, preventing the user from logging onto the machine.

This procedure is preferable to terminating a user's session by shutdown shortly after the user has logged on.

    Logins by the following users are not affected by this procedure:

  • Super-user

  • Users assigned the root role

  • Users assigned the solaris.system.maintenance authorization

The message contained in the nologin file is editable by a super-user or a user with the “Maintenance and Repairrbac(7) profile. A typical nologin file contains a message similar to:

NO LOGINS: System going down in 10 minutes.

The nologin file may be manually created by a system administrator when doing maintenance, or it may be automatically created, such as by the shutdown(8) command, by init(8) when transitioning to single user mode, or by the system when recovering a deferred dump.

The svc:/system/rmtmpfiles service will remove any existing nologin file during system boot.

See Also

login(1), pam_acct_mgmt(3PAM), pam_sm_acct_mgmt(3PAM), pam_unix_account(7), init(8), shutdown(8)

History

Support for /etc/nologin was present in SunOS 4.x releases, but not in Solaris 2.x releases until it was added in Solaris 2.5.