Debian Codegraph @

upstream/debian-unstable/man8/pam_faillock.8

raw
1 '\" t
2 .\" Title: pam_faillock
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: [FIXME: source]
8 .\" Language: English
9 .\"
10 .TH "PAM_FAILLOCK" "8" "06/29/2025" "[FIXME: source]" "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_faillock \- Module counting authentication failures during a specified interval
32 .SH "SYNOPSIS"
33 .HP \w'\fBauth\ \&.\&.\&.\ pam_faillock\&.so\fR\ 'u
34 \fBauth \&.\&.\&. pam_faillock\&.so\fR {preauth|authfail|authsucc} [conf=\fI/path/to/config\-file\fR] [dir=\fI/path/to/tally\-directory\fR] [even_deny_root] [deny=\fIn\fR] [fail_interval=\fIn\fR] [unlock_time=\fIn\fR] [root_unlock_time=\fIn\fR] [admin_group=\fIname\fR] [audit] [silent] [no_log_info]
35 .HP \w'\fBaccount\ \&.\&.\&.\ pam_faillock\&.so\fR\ 'u
36 \fBaccount \&.\&.\&. pam_faillock\&.so\fR [dir=\fI/path/to/tally\-directory\fR] [no_log_info]
37 .SH "DESCRIPTION"
38 .PP
39 This module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than
40 \fIdeny\fR
41 consecutive failed authentications\&.
42 .PP
43 Normally, failed attempts to authenticate
44 \fIroot\fR
45 will
46 \fBnot\fR
47 cause the root account to become blocked, to prevent denial\-of\-service: if your users aren\*(Aqt given shell accounts and root may only login via
48 \fBsu\fR
49 or at the machine console (not telnet/rsh, etc), this is safe\&.
50 .SH "OPTIONS"
51 .PP
52 {preauth|authfail|authsucc}
53 .RS 4
54 This argument must be set accordingly to the position of this module instance in the PAM stack\&.
55 .sp
56 The
57 \fIpreauth\fR
58 argument must be used when the module is called before the modules which ask for the user credentials such as the password\&. The module just examines whether the user should be blocked from accessing the service in case there were anomalous number of failed consecutive authentication attempts recently\&. This call is optional if
59 \fIauthsucc\fR
60 is used\&.
61 .sp
62 The
63 \fIauthfail\fR
64 argument must be used when the module is called after the modules which determine the authentication outcome, failed\&. Unless the user is already blocked due to previous authentication failures, the module will record the failure into the appropriate user tally file\&.
65 .sp
66 The
67 \fIauthsucc\fR
68 argument must be used when the module is called after the modules which determine the authentication outcome, succeeded\&. Unless the user is already blocked due to previous authentication failures, the module will then clear the record of the failures in the respective user tally file\&. Otherwise it will return authentication error\&. If this call is not done, the pam_faillock will not distinguish between consecutive and non\-consecutive failed authentication attempts\&. The
69 \fIpreauth\fR
70 call must be used in such case\&. Due to complications in the way the PAM stack can be configured it is also possible to call
71 \fIpam_faillock\fR
72 as an account module\&. In such configuration the module must be also called in the
73 \fIpreauth\fR
74 stage\&.
75 .RE
76 .PP
77 conf=/path/to/config\-file
78 .RS 4
79 Use another configuration file instead of the default
80 /etc/security/faillock\&.conf\&.
81 .RE
82 .PP
83 The options for configuring the module behavior are described in the
84 \fBfaillock.conf\fR(5)
85 manual page\&. The options specified on the module command line override the values from the configuration file\&.
86 .SH "MODULE TYPES PROVIDED"
87 .PP
88 The
89 \fBauth\fR
90 and
91 \fBaccount\fR
92 module types are provided\&.
93 .SH "RETURN VALUES"
94 .PP
95 PAM_AUTH_ERR
96 .RS 4
97 An invalid option was given, the module was not able to retrieve the user name, no valid counter file was found, or too many failed logins\&.
98 .RE
99 .PP
100 PAM_BUF_ERR
101 .RS 4
102 Memory buffer error\&.
103 .RE
104 .PP
105 PAM_CONV_ERR
106 .RS 4
107 The conversation method supplied by the application failed to obtain the username\&.
108 .RE
109 .PP
110 PAM_INCOMPLETE
111 .RS 4
112 The conversation method supplied by the application returned PAM_CONV_AGAIN\&.
113 .RE
114 .PP
115 PAM_SUCCESS
116 .RS 4
117 Everything was successful\&.
118 .RE
119 .PP
120 PAM_IGNORE
121 .RS 4
122 User not present in passwd database\&.
123 .RE
124 .SH "NOTES"
125 .PP
126 Configuring options on the module command line is not recommend\&. The
127 /etc/security/faillock\&.conf
128 should be used instead\&.
129 .PP
130 The setup of
131 \fIpam_faillock\fR
132 in the PAM stack is different from the
133 \fIpam_tally2\fR
134 module setup\&.
135 .PP
136 Individual files with the failure records are created as owned by the user\&. This allows
137 \fBpam_faillock\&.so\fR
138 module to work correctly when it is called from a screensaver\&.
139 .PP
140 Note that using the module in
141 \fBpreauth\fR
142 without the
143 \fBsilent\fR
144 option specified in
145 /etc/security/faillock\&.conf
146 or with
147 \fIrequisite\fR
148 control field leaks an information about existence or non\-existence of a user account in the system because the failures are not recorded for the unknown users\&. The message about the user account being locked is never displayed for non\-existing user accounts allowing the adversary to infer that a particular account is not existing on a system\&.
149 .SH "EXAMPLES"
150 .PP
151 Here are two possible configuration examples for
152 /etc/pam\&.d/login\&. They make
153 \fIpam_faillock\fR
154 to lock the account after 4 consecutive failed logins during the default interval of 15 minutes\&. Root account will be locked as well\&. The accounts will be automatically unlocked after 20 minutes\&.
155 .PP
156 In the first example the module is called only in the
157 \fIauth\fR
158 phase and the module does not print any information about the account being blocked by
159 \fIpam_faillock\fR\&. The
160 \fIpreauth\fR
161 call can be added to tell users that their logins are blocked by the module and also to abort the authentication without even asking for password in such case\&.
162 .PP
163 /etc/security/faillock\&.conf
164 file example:
165 .sp
166 .if n \{\
167 .RS 4
168 .\}
169 .nf
170 deny=4
171 unlock_time=1200
172 silent
173
174 .fi
175 .if n \{\
176 .RE
177 .\}
178 .PP
179 /etc/pam\&.d/config file example:
180 .sp
181 .if n \{\
182 .RS 4
183 .\}
184 .nf
185 auth required pam_securetty\&.so
186 auth required pam_env\&.so
187 auth required pam_nologin\&.so
188 # optionally call: auth requisite pam_faillock\&.so preauth
189 # to display the message about account being locked
190 auth [success=1 default=bad] pam_unix\&.so
191 auth [default=die] pam_faillock\&.so authfail
192 auth sufficient pam_faillock\&.so authsucc
193 auth required pam_deny\&.so
194 account required pam_unix\&.so
195 password required pam_unix\&.so shadow
196 session required pam_selinux\&.so close
197 session required pam_loginuid\&.so
198 session required pam_unix\&.so
199 session required pam_selinux\&.so open
200
201 .fi
202 .if n \{\
203 .RE
204 .\}
205 .PP
206 In the second example the module is called both in the
207 \fIauth\fR
208 and
209 \fIaccount\fR
210 phases and the module informs the authenticating user when the account is locked if
211 \fBsilent\fR
212 option is not specified in the
213 faillock\&.conf\&.
214 .sp
215 .if n \{\
216 .RS 4
217 .\}
218 .nf
219 auth required pam_securetty\&.so
220 auth required pam_env\&.so
221 auth required pam_nologin\&.so
222 auth required pam_faillock\&.so preauth
223 # optionally use requisite above if you do not want to prompt for the password
224 # on locked accounts
225 auth sufficient pam_unix\&.so
226 auth [default=die] pam_faillock\&.so authfail
227 auth required pam_deny\&.so
228 account required pam_faillock\&.so
229 # if you drop the above call to pam_faillock\&.so the lock will be done also
230 # on non\-consecutive authentication failures
231 account required pam_unix\&.so
232 password required pam_unix\&.so shadow
233 session required pam_selinux\&.so close
234 session required pam_loginuid\&.so
235 session required pam_unix\&.so
236 session required pam_selinux\&.so open
237
238 .fi
239 .if n \{\
240 .RE
241 .\}
242 .SH "FILES"
243 .PP
244 /var/run/faillock/*
245 .RS 4
246 the files logging the authentication failures for users
247 .sp
248 Note: These files will disappear after reboot on systems configured with directory
249 /var/run/faillock
250 mounted on virtual memory\&. For persistent storage use the option
251 \fIdir=\fR
252 in file
253 /etc/security/faillock\&.conf\&.
254 .RE
255 .PP
256 /etc/security/faillock\&.conf
257 .RS 4
258 the config file for pam_faillock options
259 .RE
260 .SH "SEE ALSO"
261 .PP
262 \fBfaillock\fR(8),
263 \fBfaillock.conf\fR(5),
264 \fBpam.conf\fR(5),
265 \fBpam.d\fR(5),
266 \fBpam\fR(8)
267 .SH "AUTHOR"
268 .PP
269 pam_faillock was written by Tomas Mraz\&.