---
name: "nologin"
section: "5"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/nologin/5"
---

# nologin(5)

disallow logins

## NAME

**nologin** – disallow logins

## DESCRIPTION

Programs such as [login(1)](/login/1.md) 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)](/nologin/8.md).

## SECURITY

The **nologin** file is ignored for user root by default.

## IMPLEMENTATION NOTES

The **nologin** feature is implemented through [login.conf(5)](/login.conf/5.md), 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)](/pam_nologin/8.md) module via [pam.conf(5)](/pam.conf/5.md).

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)](/rc.conf/5.md), which is default. Therefore system reboot can effectively re-enable logins.

## FILES

- */var/run/nologin*

  default location of **nologin**

## SEE ALSO

[login(1)](/login/1.md), [login.conf(5)](/login.conf/5.md), [pam.conf(5)](/pam.conf/5.md), [rc.conf(5)](/rc.conf/5.md), [nologin(8)](/nologin/8.md), [pam\_nologin(8)](/pam_nologin/8.md), [shutdown(8)](/shutdown/8.md)
