nologin(5)

nologin5

Disallow logins

Overview

Programs such as login(1) disallow logins if the nologin file exists. The programs display the contents of nologin to the user if possible and interrupt the login sequence. This makes it simple to temporarily prevent incoming logins systemwide.

To disable logins on a per-account basis, investigate nologin(8).

Security

The nologin file is ignored for user root by default.

Implementation notes

The nologin feature is implemented through login.conf(5), which allows to change the pathname of the file and to extend the list of users exempt from temporary login restriction.

PAM-aware programs can be selectively configured to respect nologin using the pam_nologin(8) module via pam.conf(5).

The nologin file will be removed at system boot if it resides in /var/run and cleanvar_enable is set to “YES” in rc.conf(5), which is default. Therefore system reboot can effectively re-enable logins.

Files

/var/run/nologin

default location of nologin

Releases

106 releases since Mac OS X 10.6; the text changed 1 time.

  1. 10.6–12.5
  2. 13.0–26.5

From system_cmds 1042.120.1 in macOS 26.5. Parsed by carta from the page's mdoc source.