PAM_NOLOGIN(8)
๐
pam_nologin โ from the PAM_NOLOGIN(8) girlies ๐
okay so bestie, you're reading the Linux-PAM Manual page for pam_nologin, and honestly? it's giving "bouncer at the club door but for your whole system" ๐ฅ let's get into it.
โจ NAME โจ
pam_nologin โ no cap, this one is literally just Prevent non-root users from login ๐
๐ฆ SYNOPSIS ๐ฆ
pam_nologin.so [file=/path/nologin] [successok]
she's short, she's sweet, she has two optional little arguments and she knows it โจ
๐ธ DESCRIPTION ๐ธ
so here's the tea: pam_nologin is a PAM module that stops users from logging into the system whenever /var/run/nologin or /etc/nologin exists. that's the whole vibe check ๐
and the contents of that file? they get displayed to the user ๐ข so if you want to leave a little note like "brb maintenance, come back later bestie", that's literally the mechanism, slay.
but โ and this is the important part โ the pam_nologin module has no effect on the root user's ability to log in. root stays in the club, always. main character energy fr fr ๐
๐ OPTIONS ๐
file=/path/nologinโ use this file instead of the default/var/run/nologinor/etc/nologin. custom file, custom drama, we love options ๐ซถsuccessokโ returnPAM_SUCCESSif no file exists. the default isPAM_IGNOREinstead. that's it, that's the flag โจ
๐ MODULE TYPES PROVIDED ๐
the auth and account module types are provided. two icons, one module, periodt ๐
๐ RETURN VALUES ๐
PAM_AUTH_ERRโ the user is not root and/etc/nologinexists, so the user is not permitted to log in. door's closed babe ๐ญPAM_BUF_ERRโ memory buffer error. not the vibe ๐PAM_IGNOREโ this is the default return value. the chill one ๐ฆPAM_SUCCESSโ success: either the user is root or the nologin file does not exist. both paths are a W ๐PAM_USER_UNKNOWNโ user not known to the underlying authentication module. she doesn't know you like that ๐
โญ EXAMPLES โญ
the suggested usage for /etc/pam.d/login is:
auth required pam_nologin.so
short. iconic. copy it into your config and move on with your day ๐
๐ฅ NOTES ๐ฅ
okay listen, this is the part where we get serious for a sec, no cap:
in order to make this module effective, all login methods should be secured by it. it should be used as a required method listed before any sufficient methods in order to get standard Unix nologin semantics. order matters, bestie, the stacking is real ๐
and now the big warning: note that the use of thesuccessokmodule argument causes the module to returnPAM_SUCCESS, and as such would break such a configuration โ failingsufficientmodules would lead to a successful login because the nologin module succeeded. like, the guard just let everyone in and called it a win ๐ญ so be careful withsuccessok, fr fr.
๐ง SEE ALSO ๐ง
nologin(5), pam.conf(5), pam.d(5), pam(8) โ go read your sisters, they're all icons in their own right ๐
๐ AUTHOR ๐
pam_nologin was written by Michael K. Johnson <johnsonm@redhat.com>. thank you king ๐ซถ
and that's the page, bestie!! this one came from the Linux-PAM manual, dated 09/27/2026, and honestly it ate. go forth and nologin responsibly ๐โจ๐
๐ฆ where this page comes from
- arch rolling: pam 1.7.3-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms