1PAM_TALLY2(8)                  Linux-PAM Manual                  PAM_TALLY2(8)
2
3
4

NAME

6       pam_tally2 - The login counter (tallying) module
7

SYNOPSIS

9       pam_tally2.so [file=/path/to/counter] [onerr=[fail|succeed]]
10                     [magic_root] [even_deny_root] [deny=n] [lock_time=n]
11                     [unlock_time=n] [root_unlock_time=n] [serialize] [audit]
12                     [silent] [no_log_info]
13
14       pam_tally2 [--file /path/to/counter] [--user username] [--reset[=n]]
15                  [--quiet]
16

DESCRIPTION

18       This module maintains a count of attempted accesses, can reset count on
19       success, can deny access if too many attempts fail.
20
21       pam_tally2 comes in two parts: pam_tally2.so and pam_tally2. The former
22       is the PAM module and the latter, a stand-alone program.  pam_tally2 is
23       an (optional) application which can be used to interrogate and
24       manipulate the counter file. It can display users' counts, set
25       individual counts, or clear all counts. Setting artificially high
26       counts may be useful for blocking users without changing their
27       passwords. For example, one might find it useful to clear all counts
28       every midnight from a cron job.
29
30       Normally, failed attempts to access root will not cause the root
31       account to become blocked, to prevent denial-of-service: if your users
32       aren't given shell accounts and root may only login via su or at the
33       machine console (not telnet/rsh, etc), this is safe.
34

OPTIONS

36       GLOBAL OPTIONS
37           This can be used for auth and account module types.
38
39           onerr=[fail|succeed]
40               If something weird happens (like unable to open the file),
41               return with PAM_SUCCESS if onerr=succeed is given, else with
42               the corresponding PAM error code.
43
44           file=/path/to/counter
45               File where to keep counts. Default is /var/log/tallylog.
46
47           audit
48               Will log the user name into the system log if the user is not
49               found.
50
51           silent
52               Don't print informative messages.
53
54           no_log_info
55               Don't log informative messages via syslog(3).
56
57       AUTH OPTIONS
58           Authentication phase first increments attempted login counter and
59           checks if user should be denied access. If the user is
60           authenticated and the login process continues on call to
61           pam_setcred(3) it resets the attempts counter.
62
63           deny=n
64               Deny access if tally for this user exceeds n.
65
66           lock_time=n
67               Always deny for n seconds after failed attempt.
68
69           unlock_time=n
70               Allow access after n seconds after failed attempt. If this
71               option is used the user will be locked out for the specified
72               amount of time after he exceeded his maximum allowed attempts.
73               Otherwise the account is locked until the lock is removed by a
74               manual intervention of the system administrator.
75
76           magic_root
77               If the module is invoked by a user with uid=0 the counter is
78               not incremented. The sysadmin should use this for user launched
79               services, like su, otherwise this argument should be omitted.
80
81           even_deny_root
82               Root account can become unavailable.
83
84           root_unlock_time=n
85               This option implies even_deny_root option. Allow access after n
86               seconds to root account after failed attempt. If this option is
87               used the root user will be locked out for the specified amount
88               of time after he exceeded his maximum allowed attempts.
89
90           serialize
91               Serialize access to the tally file using locks. This option
92               might be used only for non-multithreaded services because it
93               depends on the fcntl locking of the tally file. Also it is a
94               good idea to use this option only in such configurations where
95               the time between auth phase and account or setcred phase is not
96               dependent on the authenticating client. Otherwise the
97               authenticating client will be able to prevent simultaneous
98               authentications by the same user by simply artificially
99               prolonging the time the file record lock is held.
100
101       ACCOUNT OPTIONS
102           Account phase resets attempts counter if the user is not magic
103           root. This phase can be used optionally for services which don't
104           call pam_setcred(3) correctly or if the reset should be done
105           regardless of the failure of the account phase of other modules.
106
107           magic_root
108               If the module is invoked by a user with uid=0 the counter is
109               not changed. The sysadmin should use this for user launched
110               services, like su, otherwise this argument should be omitted.
111

MODULE TYPES PROVIDED

113       The auth and account module types are provided.
114

RETURN VALUES

116       PAM_AUTH_ERR
117           A invalid option was given, the module was not able to retrieve the
118           user name, no valid counter file was found, or too many failed
119           logins.
120
121       PAM_SUCCESS
122           Everything was successful.
123
124       PAM_USER_UNKNOWN
125           User not known.
126

NOTES

128       pam_tally2 is not compatible with the old pam_tally faillog file
129       format. This is caused by requirement of compatibility of the tallylog
130       file format between 32bit and 64bit architectures on multiarch systems.
131
132       There is no setuid wrapper for access to the data file such as when the
133       pam_tally2.so module is called from xscreensaver. As this would make it
134       impossible to share PAM configuration with such services the following
135       workaround is used: If the data file cannot be opened because of
136       insufficient permissions (EACCES) the module returns PAM_IGNORE.
137

EXAMPLES

139       Add the following line to /etc/pam.d/login to lock the account after 4
140       failed logins. Root account will be locked as well. The accounts will
141       be automatically unlocked after 20 minutes. The module does not have to
142       be called in the account phase because the login calls pam_setcred(3)
143       correctly.
144
145           auth     required       pam_securetty.so
146           auth     required       pam_tally2.so deny=4 even_deny_root unlock_time=1200
147           auth     required       pam_env.so
148           auth     required       pam_unix.so
149           auth     required       pam_nologin.so
150           account  required       pam_unix.so
151           password required       pam_unix.so
152           session  required       pam_limits.so
153           session  required       pam_unix.so
154           session  required       pam_lastlog.so nowtmp
155           session  optional       pam_mail.so standard
156
157

FILES

159       /var/log/tallylog
160           failure count logging file
161

SEE ALSO

163       pam.conf(5), pam.d(5), pam(8)
164

AUTHOR

166       pam_tally2 was written by Tim Baverstock and Tomas Mraz.
167
168
169
170Linux-PAM Manual                  09/19/2013                     PAM_TALLY2(8)
Impressum