Debian Codegraph @

upstream/debian-unstable/man8/pam_nologin.8

raw
1 '\" t
2 .\" Title: pam_nologin
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
5 .\" Date: 06/29/2025
6 .\" Manual: Linux-PAM Manual
7 .\" Source: Linux-PAM
8 .\" Language: English
9 .\"
10 .TH "PAM_NOLOGIN" "8" "06/29/2025" "Linux\-PAM" "Linux\-PAM Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 pam_nologin \- Prevent non\-root users from login
32 .SH "SYNOPSIS"
33 .HP \w'\fBpam_nologin\&.so\fR\ 'u
34 \fBpam_nologin\&.so\fR [file=\fI/path/nologin\fR] [successok]
35 .SH "DESCRIPTION"
36 .PP
37 pam_nologin is a PAM module that prevents users from logging into the system when
38 /var/run/nologin
39 or
40 /etc/nologin
41 exists\&. The contents of the file are displayed to the user\&. The pam_nologin module has no effect on the root user\*(Aqs ability to log in\&.
42 .SH "OPTIONS"
43 .PP
44 file=/path/nologin
45 .RS 4
46 Use this file instead the default
47 /var/run/nologin
48 or
49 /etc/nologin\&.
50 .RE
51 .PP
52 successok
53 .RS 4
54 Return PAM_SUCCESS if no file exists, the default is PAM_IGNORE\&.
55 .RE
56 .SH "MODULE TYPES PROVIDED"
57 .PP
58 The
59 \fBauth\fR
60 and
61 \fBaccount\fR
62 module types are provided\&.
63 .SH "RETURN VALUES"
64 .PP
65 PAM_AUTH_ERR
66 .RS 4
67 The user is not root and
68 /etc/nologin
69 exists, so the user is not permitted to log in\&.
70 .RE
71 .PP
72 PAM_BUF_ERR
73 .RS 4
74 Memory buffer error\&.
75 .RE
76 .PP
77 PAM_IGNORE
78 .RS 4
79 This is the default return value\&.
80 .RE
81 .PP
82 PAM_SUCCESS
83 .RS 4
84 Success: either the user is root or the nologin file does not exist\&.
85 .RE
86 .PP
87 PAM_USER_UNKNOWN
88 .RS 4
89 User not known to the underlying authentication module\&.
90 .RE
91 .SH "EXAMPLES"
92 .PP
93 The suggested usage for
94 /etc/pam\&.d/login
95 is:
96 .sp
97 .if n \{\
98 .RS 4
99 .\}
100 .nf
101 auth required pam_nologin\&.so
102
103 .fi
104 .if n \{\
105 .RE
106 .\}
107 .sp
108 .SH "NOTES"
109 .PP
110 In order to make this module effective, all login methods should be secured by it\&. It should be used as a
111 \fIrequired\fR
112 method listed before any
113 \fIsufficient\fR
114 methods in order to get standard Unix nologin semantics\&. Note, the use of
115 \fBsuccessok\fR
116 module argument causes the module to return
117 \fIPAM_SUCCESS\fR
118 and as such would break such a configuration \- failing
119 \fIsufficient\fR
120 modules would lead to a successful login because the nologin module
121 \fIsucceeded\fR\&.
122 .SH "SEE ALSO"
123 .PP
124 \fBnologin\fR(5),
125 \fBpam.conf\fR(5),
126 \fBpam.d\fR(5),
127 \fBpam\fR(7)
128 .SH "AUTHOR"
129 .PP
130 pam_nologin was written by Michael K\&. Johnson <johnsonm@redhat\&.com>\&.