]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs:
authorThorsten Kukuk <kukuk@thkukuk.de>
Sun, 18 Jun 2006 16:08:02 +0000 (16:08 +0000)
committerThorsten Kukuk <kukuk@thkukuk.de>
Sun, 18 Jun 2006 16:08:02 +0000 (16:08 +0000)
Purpose of commit: new feature

Commit summary:
---------------

2006-06-18  Thorsten Kukuk  <kukuk@thkukuk.de>

        * modules/pam_tally/Makefile.am: Include Make.xml.rules.
        * modules/pam_tally/pam_tally.8.xml: New.
        * modules/pam_tally/pam_tally.8: New, generated from xml file.
        * modules/pam_tally/README.xml: New.
        * modules/pam_tally/README: Regenerated from xml file.

ChangeLog
NEWS
modules/pam_tally/Makefile.am
modules/pam_tally/README
modules/pam_tally/README.xml [new file with mode: 0644]
modules/pam_tally/pam_tally.8 [new file with mode: 0644]
modules/pam_tally/pam_tally.8.xml [new file with mode: 0644]

index d3b76be607abb2f2efb1a6e3cb5ee328cbdb25a4..8e5d3819b3d005ac043de006c418035ca8b5e96c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-06-18  Thorsten Kukuk  <kukuk@thkukuk.de>
 
+       * modules/pam_tally/Makefile.am: Include Make.xml.rules.
+       * modules/pam_tally/pam_tally.8.xml: New.
+       * modules/pam_tally/pam_tally.8: New, generated from xml file.
+       * modules/pam_tally/README.xml: New.
+       * modules/pam_tally/README: Regenerated from xml file.
+
        * modules/pam_selinux/Makefile.am: Include Make.xml.rules.
        * modules/pam_selinux/pam_selinux.8.xml: New.
        * modules/pam_selinux/pam_selinux.8: Regenerated from xml file.
diff --git a/NEWS b/NEWS
index 6b0506eba973fb8f3b3d11b8464347bc2149e8e6..d36e7c6b76551c66996cb649a0c168c696c2eb95 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ Linux-PAM NEWS -- history of user-visible changes.
   pam_issue, pam_ftp, pam_group, pam_lastlog, pam_listfile,
   pam_localuser, pam_mail, pam_motd, pam_nologin, pam_permit,
   pam_rootok, pam_securetty, pam_shells, pam_userdb, pam_warn,
-  pam_time, pam_limits, pam_debug
+  pam_time, pam_limits, pam_debug, pam_tally
 * The libpam memory debug code was removed
 
 Release 0.99.4.0
index 8b8c63bf070af5fb1a2045e8e2307802633d9002..72a704018234edfb379d1791f74921d150ff4862 100644 (file)
@@ -4,7 +4,10 @@
 
 CLEANFILES = *~
 
-EXTRA_DIST = README tst-pam_tally
+EXTRA_DIST = README $(MANS) $(XMLS) tst-pam_tally
+
+man_MANS = pam_tally.8
+XMLS = README.xml pam_tally.8.xml
 
 TESTS = tst-pam_tally
 
@@ -25,3 +28,10 @@ securelib_LTLIBRARIES = pam_tally.la
 sbin_PROGRAMS = pam_tally
 
 pam_tally_SOURCES = pam_tally_app.c
+
+if ENABLE_REGENERATE_MAN
+noinst_DATA = README
+README: pam_tally.8.xml
+-include $(top_srcdir)/Make.xml.rules
+endif
+
index c8b715bdca037ea93f03ad6939f7d26955cec5fa..cfd8a46819bc332c997572c5e168383e5faef938 100644 (file)
-SUMMARY:
-  pam_tally.so:
-
-        Maintains a count of attempted accesses, can reset count on success,
-                can deny access if too many attempts fail.
-
-        Options:
-
-                * onerr=[succeed|fail] (if something weird happens
-                        such as unable to open the file, what to do?)
-                * file=/where/to/keep/counts (default /var/log/faillog)
-               * audit (will display the username typed if the user is not found)
-
-        (auth)
-            Authentication phase first checks if user should be denied access
-           and if not it increments attempted login counter. Then on call to
-           pam_setcred it resets the attempts counter if the user is NOT
-           magic root.
-                * deny=n (deny access if tally for this user exceeds n)
-               
-               * lock_time=n (always deny for n seconds after failed attempt)
-               
-               * unlock_time=n (allow access after n seconds after the last
-                       failed attempt with exceeded tally)
-                
-                * magic_root (access attempts by root as requesting user ignore
-                       deny and don't change counter.
-                        Use this for su and similar services.)
-
-                * even_deny_root_account (Root can become unavailable. BEWARE.
-                        Note that magic root trying to gain root bypasses this,
-                        but normal users can be locked out.)
-                
-               * per_user (If /var/log/faillog contains a non-zero
-                       .fail_max/.fail_locktime field for this user then use it
-                       instead of deny=n/lock_time=n parameter.)
-
-               * no_lock_time (Don't use .fail_locktime filed in
-                       /var/log/faillog for this user)
-
-                * no_reset (don't reset count on successful entry,
-                       only decrement)
-
-                
-        (account)
-            Account phase resets attempts counter if the user is NOT magic root.
-           This phase can be used optionaly for services which don't call
-           pam_setcred correctly or if the reset should be done regardless
-           of the failure of the account phase of other modules.
-           
-                * magic_root (access attempts by root as requesting user 
-                       don't change counter.
-                        Use this for su and similar services.)
-
-                * no_reset (don't reset count on successful entry,
-                       only decrement)
-
-        Also checks to make sure that the counts file is a plain
-        file and not world writable.
-
-        - Tim Baverstock <warwick@sable.demon.co.uk>, v0.1 5 March 1997
-       - Tomas Mraz <tmraz@redhat.com>, v0.2 5 January 2005
-
-LONGER:
-
-pam_tally comes in two parts: pam_tally.so and pam_tally.
-
-pam_tally.so sits in a pam config file, in the auth and account sections.
-
-In the auth section, it denies access if attempted logins exceed some
-threshold and it increments a per-uid counter for each attempted login,
-in the account section, it resets that counter to zero on successful
-login. If the module isn't used in the account section it resets the counter
-to zero on call to pam_setcred.
-
-Root is treated specially:
-
-1. When a process already running as root tries to access some service and the
-'magic_root' flag is set, the access is `magic', and bypasses pam_tally's 
-checks: handy for `su'ing from root into an account otherwise blocked.
-NOTE: This was changed from the previous version of pam_tally where the default
-was to treat root as magic and there were the 'no_magic_root' flag. However
-for most of services the current default make sense.
-
-2. Normally, failed attempts to access root will NOT cause the root 
-account to become blocked, to prevent denial-of-service: if your users aren't 
-given shell accounts and root may only login via `su' or at the machine 
-console (not telnet/rsh, etc), this is safe. If you really want root to be
-blocked for some given service, use even_deny_root_account.
-
-pam_tally is an (optional) application which can be used to interrogate and 
-manipulate the counter file. It can display users' counts, set individual 
-counts, or clear all counts. Setting artificially high counts may be useful 
-for blocking users without changing their passwords. I found it useful to 
-clear all counts every midnight from a cron..
-
-The counts file is organised as a binary-word array, indexed by uid. You
-can probably make sense of it with `od', if you don't want to use the
-supplied application.
-
-BUGS:
-
-pam_tally is very dependant on getpw*(): a database of usernames
-would be much more flexible.
-
-The (4.0 Redhat) utilities seem to do funny things with uid, and I'm
-not wholly sure I understood what I should have been doing anyway so
-the `keep a count of current logins' bit has been #ifdef'd out and you
-can only reset the counter on successful authentication, for now.
-
-IMPORTANT NOTICE:
-In the original version of pam_tally there was a bug where the information
-if the password was correct or not was leaked by returning error from
-different pam management phases. This was solved by moving the denying
-functionality to the auth phase. However it's necessary to update the pam
-configuration by moving the required options (as deny=N) to the auth phase.
+pam_tally — The login counter (tallying) module
+
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+DESCRIPTION
+
+This module maintains a count of attempted accesses, can reset count on
+success, can deny access if too many attempts fail.
+
+pam_tally comes in two parts: pam_tally.so and pam_tally. The former is the PAM
+module and the latter, a stand-alone program. pam_tally is an (optional)
+application which can be used to interrogate and manipulate the counter file.
+It can display users' counts, set individual counts, or clear all counts.
+Setting artificially high counts may be useful for blocking users without
+changing their passwords. For example, one might find it useful to clear all
+counts every midnight from a cron job. The faillog(8) command can be used
+instead of pam_tally to to maintain the counter file.
+
+Normally, failed attempts to access root will not cause the root account to
+become blocked, to prevent denial-of-service: if your users aren't given shell
+accounts and root may only login via su or at the machine console (not telnet/
+rsh, etc), this is safe.
+
+OPTIONS
+
+GLOBAL OPTIONS
+
+    This can be used for auth and account services.
+
+    onerr=[fail|succeed]
+
+        If something weird happens (like unable to open the file), return with
+        PAM_SUCESS if onerr=succeed is given, else with the corresponding PAM
+        error code.
+
+    file=/path/to/counter
+
+        File where to keep counts. Default is /var/log/faillog.
+
+    audit
+
+        Will display the username typed if the user is not found.
+
+AUTH OPTIONS
+
+    Authentication phase first checks if user should be denied access and if
+    not it increments attempted login counter. Then on call to pam_setcred(3)
+    it resets the attempts counter.
+
+    deny=n
+
+        Deny access if tally for this user exceeds n.
+
+    lock_time=n
+
+        Always deny for n seconds after failed attempt.
+
+    unlock_time=n
+
+        Allow access after n seconds after failed attempt. If this option is
+        used the user will be locked out for the specified amount of time after
+        he exceeded his maximum allowed attempts. Otherwise the account is
+        locked until the lock is removed by a manual intervention of the system
+        administrator.
+
+    magic_root
+
+        If the module is invoked by a user with uid=0 the counter is not
+        incremented. The sys-admin should use this for user launched services,
+        like su, otherwise this argument should be omitted.
+
+    no_lock_time
+
+        Do not use the .fail_locktime field in /var/log/faillog for this user.
+
+    no_reset
+
+        Don't reset count on successful entry, only decrement.
+
+    even_deny_root_account
+
+        Root account can become unavailable.
+
+    even_deny_root_account
+
+        Root account can become unavailable.
+
+    per_user
+
+        If /var/log/faillog contains a non-zero .fail_max/.fail_locktime field
+        for this user then use it instead of deny=n/ lock_time=n parameter.
+
+    no_lock_time
+
+        Don't use .fail_locktime filed in /var/log/faillog for this user.
+
+ACCOUNT OPTIONS
+
+    Account phase resets attempts counter if the user is not magic root. This
+    phase can be used optionaly for services which don't call pam_setcred(3)
+    correctly or if the reset should be done regardless of the failure of the
+    account phase of other modules.
+
+    magic_root
+
+        If the module is invoked by a user with uid=0 the counter is not
+        incremented. The sys-admin should use this for user launched services,
+        like su, otherwise this argument should be omitted.
+
+    no_reset
+
+        Don't reset count on successful entry, only decrement.
+
+EXAMPLES
+
+Add the following line to /etc/pam.d/login to lock the account after too many
+failed logins. The number of allowed fails is specified by /var/log/faillog and
+needs to be set with pam_tally or faillog(8) before.
+
+auth     required       pam_securetty.so
+auth     required       pam_tally.so per_user
+auth     required       pam_env.so
+auth     required       pam_unix.so
+auth     required       pam_nologin.so
+account  required       pam_unix.so
+password required       pam_unix.so
+session  required       pam_limits.so
+session  required       pam_unix.so
+session  required       pam_lastlog.so nowtmp
+session  optional       pam_mail.so standard
+
+
+AUTHOR
+
+pam_tally was written by Tim Baverstock and Tomas Mraz.
+
diff --git a/modules/pam_tally/README.xml b/modules/pam_tally/README.xml
new file mode 100644 (file)
index 0000000..3c6de50
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.docbook.org/xml/4.3/docbookx.dtd"
+[
+<!--
+<!ENTITY pamaccess SYSTEM "pam_tally.8.xml">
+-->
+]>
+
+<article>
+
+  <articleinfo>
+
+    <title>
+      <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+      href="pam_tally.8.xml" xpointer='xpointer(//refnamediv[@id = "pam_tally-name"]/*)'/>
+    </title>
+
+  </articleinfo>
+
+  <section>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+      href="pam_tally.8.xml" xpointer='xpointer(//refsect1[@id = "pam_tally-description"]/*)'/>
+  </section>
+
+  <section>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+      href="pam_tally.8.xml" xpointer='xpointer(//refsect1[@id = "pam_tally-options"]/*)'/>
+  </section>
+
+  <section>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+      href="pam_tally.8.xml" xpointer='xpointer(//refsect1[@id = "pam_tally-examples"]/*)'/>
+  </section>
+
+  <section>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+      href="pam_tally.8.xml" xpointer='xpointer(//refsect1[@id = "pam_tally-author"]/*)'/>
+  </section>
+
+</article>
diff --git a/modules/pam_tally/pam_tally.8 b/modules/pam_tally/pam_tally.8
new file mode 100644 (file)
index 0000000..a4476b6
--- /dev/null
@@ -0,0 +1,188 @@
+.\"     Title: pam_tally
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
+.\"      Date: 06/18/2006
+.\"    Manual: Linux\-PAM Manual
+.\"    Source: Linux\-PAM Manual
+.\"
+.TH "PAM_TALLY" "8" "06/18/2006" "Linux\-PAM Manual" "Linux\-PAM Manual"
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+pam_tally \- The login counter (tallying) module
+.SH "SYNOPSIS"
+.HP 13
+\fBpam_tally.so\fR [file=\fI/path/to/counter\fR] [onerr=[\fIfail\fR|\fIsucceed\fR]] [magic_root] [even_deny_root_account] [deny=\fIn\fR] [lock_time=\fIn\fR] [unlock_time=\fIn\fR] [per_user] [no_lock_time] [no_reset] [audit]
+.HP 10
+\fBpam_tally\fR [\-\-file\ \fI/path/to/counter\fR] [\-\-user\ \fIusername\fR] [\-\-reset[=\fIn\fR]] [\-\-quiet]
+.SH "DESCRIPTION"
+.PP
+This module maintains a count of attempted accesses, can reset count on success, can deny access if too many attempts fail.
+.PP
+pam_tally comes in two parts:
+\fBpam_tally.so\fR
+and
+\fBpam_tally\fR. The former is the PAM module and the latter, a stand\-alone program.
+\fBpam_tally\fR
+is an (optional) application which can be used to interrogate and manipulate the counter file. It can display users' counts, set individual counts, or clear all counts. Setting artificially high counts may be useful for blocking users without changing their passwords. For example, one might find it useful to clear all counts every midnight from a cron job. The
+\fBfaillog\fR(8)
+command can be used instead of pam_tally to to maintain the counter file.
+.PP
+Normally, failed attempts to access
+\fIroot\fR
+will
+\fBnot\fR
+cause the root account to become blocked, to prevent denial\-of\-service: if your users aren't given shell accounts and root may only login via
+\fBsu\fR
+or at the machine console (not telnet/rsh, etc), this is safe.
+.SH "OPTIONS"
+.TP 3n
+GLOBAL OPTIONS
+This can be used for
+\fIauth\fR
+and
+\fIaccount\fR
+services.
+.RS 3n
+.TP 3n
+\fBonerr=[\fR\fB\fIfail\fR\fR\fB|\fR\fB\fIsucceed\fR\fR\fB]\fR
+If something weird happens (like unable to open the file), return with
+\fBPAM_SUCESS\fR
+if
+\fBonerr=\fR\fB\fIsucceed\fR\fR
+is given, else with the corresponding PAM error code.
+.TP 3n
+\fBfile=\fR\fB\fI/path/to/counter\fR\fR
+File where to keep counts. Default is
+\fI/var/log/faillog\fR.
+.TP 3n
+\fBaudit\fR
+Will display the username typed if the user is not found.
+.RE
+.TP 3n
+AUTH OPTIONS
+Authentication phase first checks if user should be denied access and if not it increments attempted login counter. Then on call to
+\fBpam_setcred\fR(3)
+it resets the attempts counter.
+.RS 3n
+.TP 3n
+\fBdeny=\fR\fB\fIn\fR\fR
+Deny access if tally for this user exceeds
+\fIn\fR.
+.TP 3n
+\fBlock_time=\fR\fB\fIn\fR\fR
+Always deny for
+\fIn\fR
+seconds after failed attempt.
+.TP 3n
+\fBunlock_time=\fR\fB\fIn\fR\fR
+Allow access after
+\fIn\fR
+seconds after failed attempt. If this option is used the user will be locked out for the specified amount of time after he exceeded his maximum allowed attempts. Otherwise the account is locked until the lock is removed by a manual intervention of the system administrator.
+.TP 3n
+\fBmagic_root\fR
+If the module is invoked by a user with uid=0 the counter is not incremented. The sys\-admin should use this for user launched services, like
+\fBsu\fR, otherwise this argument should be omitted.
+.TP 3n
+\fBno_lock_time\fR
+Do not use the .fail_locktime field in
+\fI/var/log/faillog\fR
+for this user.
+.TP 3n
+\fBno_reset\fR
+Don't reset count on successful entry, only decrement.
+.TP 3n
+\fBeven_deny_root_account\fR
+Root account can become unavailable.
+.TP 3n
+\fBeven_deny_root_account\fR
+Root account can become unavailable.
+.TP 3n
+\fBper_user\fR
+If
+\fI/var/log/faillog\fR
+contains a non\-zero .fail_max/.fail_locktime field for this user then use it instead of
+\fBdeny=\fR\fB\fIn\fR\fR/
+\fBlock_time=\fR\fB\fIn\fR\fR
+parameter.
+.TP 3n
+\fBno_lock_time\fR
+Don't use .fail_locktime filed in
+\fI/var/log/faillog\fR
+for this user.
+.RE
+.TP 3n
+ACCOUNT OPTIONS
+Account phase resets attempts counter if the user is
+\fBnot\fR
+magic root. This phase can be used optionaly for services which don't call
+\fBpam_setcred\fR(3)
+correctly or if the reset should be done regardless of the failure of the account phase of other modules.
+.RS 3n
+.TP 3n
+\fBmagic_root\fR
+If the module is invoked by a user with uid=0 the counter is not incremented. The sys\-admin should use this for user launched services, like
+\fBsu\fR, otherwise this argument should be omitted.
+.TP 3n
+\fBno_reset\fR
+Don't reset count on successful entry, only decrement.
+.RE
+.SH "MODULE SERVICES PROVIDED"
+.PP
+The
+\fBauth\fR
+and
+\fBaccount\fR
+services are supported.
+.SH "RETURN VALUES"
+.TP 3n
+PAM_AUTH_ERR
+A invalid option was given, the module was not able to retrive the user name, no valid counter file was found, or too many failed logins.
+.TP 3n
+PAM_SUCCESS
+Everything was successfull.
+.TP 3n
+PAM_USER_UNKNOWN
+User not known.
+.SH "EXAMPLES"
+.PP
+Add the following line to
+\fI/etc/pam.d/login\fR
+to lock the account after too many failed logins. The number of allowed fails is specified by
+\fI/var/log/faillog\fR
+and needs to be set with pam_tally or
+\fBfaillog\fR(8)
+before.
+.sp
+.RS 3n
+.nf
+auth     required       pam_securetty.so
+auth     required       pam_tally.so per_user
+auth     required       pam_env.so
+auth     required       pam_unix.so
+auth     required       pam_nologin.so
+account  required       pam_unix.so
+password required       pam_unix.so
+session  required       pam_limits.so
+session  required       pam_unix.so
+session  required       pam_lastlog.so nowtmp
+session  optional       pam_mail.so standard
+    
+.fi
+.RE
+.SH "FILES"
+.TP 3n
+\fI/var/log/faillog\fR
+failure logging file
+.SH "SEE ALSO"
+.PP
+
+\fBfaillog\fR(8),
+\fBpam.conf\fR(5),
+\fBpam.d\fR(8),
+\fBpam\fR(8)
+.SH "AUTHOR"
+.PP
+pam_tally was written by Tim Baverstock and Tomas Mraz.
diff --git a/modules/pam_tally/pam_tally.8.xml b/modules/pam_tally/pam_tally.8.xml
new file mode 100644 (file)
index 0000000..1261130
--- /dev/null
@@ -0,0 +1,437 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+       "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+<refentry id="pam_tally">
+
+  <refmeta>
+    <refentrytitle>pam_tally</refentrytitle>
+    <manvolnum>8</manvolnum>
+    <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo>
+  </refmeta>
+
+  <refnamediv id="pam_tally-name">
+    <refname>pam_tally</refname>
+    <refpurpose>The login counter (tallying) module</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis id="pam_tally-cmdsynopsis1">
+      <command>pam_tally.so</command>
+      <arg choice="opt">
+       file=<replaceable>/path/to/counter</replaceable>
+      </arg>
+      <arg choice="opt">
+        onerr=[<replaceable>fail</replaceable>|<replaceable>succeed</replaceable>]
+      </arg>
+      <arg choice="opt">
+        magic_root
+      </arg>
+      <arg choice="opt">
+        even_deny_root_account
+      </arg>
+      <arg choice="opt">
+        deny=<replaceable>n</replaceable>
+      </arg>
+      <arg choice="opt">
+        lock_time=<replaceable>n</replaceable>
+      </arg>
+      <arg choice="opt">
+        unlock_time=<replaceable>n</replaceable>
+      </arg>
+      <arg choice="opt">
+        per_user
+      </arg>
+      <arg choice="opt">
+        no_lock_time
+      </arg>
+      <arg choice="opt">
+        no_reset
+      </arg>
+      <arg choice="opt">
+        audit
+      </arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="pam_tally-cmdsynopsis2">
+      <command>pam_tally</command>
+      <arg choice="opt">
+       --file <replaceable>/path/to/counter</replaceable>
+      </arg>
+      <arg choice="opt">
+       --user <replaceable>username</replaceable>
+      </arg>
+      <arg choice="opt">
+       --reset[=<replaceable>n</replaceable>]
+      </arg>
+      <arg choice="opt">
+        --quiet
+      </arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1 id="pam_tally-description">
+
+    <title>DESCRIPTION</title>
+
+    <para>
+      This module maintains a count of attempted accesses, can
+      reset count on success, can deny access if too many attempts fail.
+    </para>
+    <para>
+      pam_tally comes in two parts:
+      <emphasis remap='B'>pam_tally.so</emphasis> and
+      <command>pam_tally</command>. The former is the PAM module and
+      the latter, a stand-alone program. <command>pam_tally</command>
+      is an (optional) application which can be used to interrogate and
+      manipulate the counter file. It can display users' counts, set
+      individual counts, or clear all counts. Setting artificially high
+      counts may be useful for blocking users without changing their
+      passwords. For example, one might find it useful to clear all counts
+      every midnight from a cron job. The
+      <citerefentry>
+       <refentrytitle>faillog</refentrytitle><manvolnum>8</manvolnum>
+      </citerefentry> command can be used instead of pam_tally to to
+      maintain the counter file.
+    </para>
+    <para>
+      Normally, failed attempts to access <emphasis>root</emphasis> will
+      <emphasis remap='B'>not</emphasis> cause the root account to become
+      blocked, to prevent denial-of-service: if your users aren't given
+      shell accounts and root may only login via <command>su</command> or
+      at the machine console (not telnet/rsh, etc), this is safe.
+    </para>
+  </refsect1>
+
+  <refsect1 id="pam_tally-options">
+
+    <title>OPTIONS</title>
+    <variablelist>
+      <varlistentry>
+        <term>
+          GLOBAL OPTIONS
+        </term>
+        <listitem>
+          <para>
+            This can be used for <emphasis>auth</emphasis> and
+            <emphasis>account</emphasis> services.
+          </para>
+          <variablelist>
+            <varlistentry>
+              <term>
+                <option>onerr=[<replaceable>fail</replaceable>|<replaceable>succeed</replaceable>]</option>
+              </term>
+              <listitem>
+                <para>
+                  If something weird happens (like unable to open the file),
+                  return with <errorcode>PAM_SUCESS</errorcode> if
+                  <option>onerr=<replaceable>succeed</replaceable></option>
+                  is given, else with the corresponding PAM error code.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>file=<replaceable>/path/to/counter</replaceable></option>
+              </term>
+              <listitem>
+                <para>
+                  File where to keep counts. Default is
+                  <filename>/var/log/faillog</filename>.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>audit</option>
+              </term>
+              <listitem>
+                <para>
+                  Will display the username typed if the user is not found.
+                </para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>
+          AUTH OPTIONS
+        </term>
+        <listitem>
+          <para>
+            Authentication phase first checks if user should be denied
+            access and if not it increments attempted login counter. Then
+            on call to <citerefentry>
+             <refentrytitle>pam_setcred</refentrytitle><manvolnum>3</manvolnum>
+            </citerefentry> it resets the attempts counter.
+          </para>
+          <variablelist>
+            <varlistentry>
+              <term>
+                <option>deny=<replaceable>n</replaceable></option>
+              </term>
+              <listitem>
+                <para>
+                  Deny access if tally for this user exceeds
+                  <replaceable>n</replaceable>.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>lock_time=<replaceable>n</replaceable></option>
+              </term>
+              <listitem>
+                <para>
+                  Always deny for <replaceable>n</replaceable> seconds
+                  after failed attempt.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>unlock_time=<replaceable>n</replaceable></option>
+              </term>
+              <listitem>
+                <para>
+                  Allow access after <replaceable>n</replaceable> seconds
+                  after failed attempt. If this option is used the user will
+                  be locked out for the specified amount of time after he
+                  exceeded his maximum allowed attempts. Otherwise the
+                  account is locked until the lock is removed by a manual
+                  intervention of the system administrator.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>magic_root</option>
+              </term>
+              <listitem>
+                <para>
+                  If the module is invoked by a user with uid=0 the
+                  counter is not incremented. The sys-admin should use this
+                  for user launched services, like <command>su</command>,
+                  otherwise this argument should be omitted.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>no_lock_time</option>
+              </term>
+              <listitem>
+                <para>
+                  Do not use the .fail_locktime field in
+                  <filename>/var/log/faillog</filename> for this user.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>no_reset</option>
+              </term>
+              <listitem>
+                <para>
+                  Don't reset count on successful entry, only decrement.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>even_deny_root_account</option>
+              </term>
+              <listitem>
+                <para>
+                  Root account can become unavailable.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>even_deny_root_account</option>
+              </term>
+              <listitem>
+                <para>
+                  Root account can become unavailable.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>per_user</option>
+              </term>
+              <listitem>
+                <para>
+                  If <filename>/var/log/faillog</filename> contains a non-zero
+                  .fail_max/.fail_locktime field for this user then use it
+                  instead of <option>deny=<replaceable>n</replaceable></option>/
+                  <option>lock_time=<replaceable>n</replaceable></option> parameter.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>no_lock_time</option>
+              </term>
+              <listitem>
+                <para>
+                  Don't use .fail_locktime filed in
+                  <filename>/var/log/faillog</filename> for this user.
+                </para>
+              </listitem>
+            </varlistentry>
+
+          </variablelist>
+        </listitem>
+      </varlistentry>
+
+
+      <varlistentry>
+        <term>
+          ACCOUNT OPTIONS
+        </term>
+        <listitem>
+          <para>
+            Account phase resets attempts counter if the user is
+            <emphasis remap='B'>not</emphasis> magic root.
+            This phase can be used optionaly for services which don't call
+            <citerefentry>
+             <refentrytitle>pam_setcred</refentrytitle><manvolnum>3</manvolnum>
+            </citerefentry> correctly or if the reset should be done regardless
+            of the failure of the account phase of other modules.
+          </para>
+          <variablelist>
+            <varlistentry>
+              <term>
+                <option>magic_root</option>
+              </term>
+              <listitem>
+                <para>
+                  If the module is invoked by a user with uid=0 the
+                  counter is not incremented. The sys-admin should use this
+                  for user launched services, like <command>su</command>,
+                  otherwise this argument should be omitted.
+                </para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>
+                <option>no_reset</option>
+              </term>
+              <listitem>
+                <para>
+                  Don't reset count on successful entry, only decrement.
+                </para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+  <refsect1 id="pam_tally-services">
+    <title>MODULE SERVICES PROVIDED</title>
+    <para>
+      The <option>auth</option> and <option>account</option>
+      services are supported.
+    </para>
+  </refsect1>
+
+  <refsect1 id='pam_tally-return_values'>
+    <title>RETURN VALUES</title>
+    <variablelist>
+      <varlistentry>
+        <term>PAM_AUTH_ERR</term>
+        <listitem>
+          <para>
+            A invalid option was given, the module was not able
+            to retrive the user name, no valid counter file
+            was found, or too many failed logins.
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>PAM_SUCCESS</term>
+        <listitem>
+          <para>
+            Everything was successfull.
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>PAM_USER_UNKNOWN</term>
+        <listitem>
+          <para>
+           User not known.
+          </para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+  <refsect1 id='pam_tally-examples'>
+    <title>EXAMPLES</title>
+    <para>
+      Add the following line to <filename>/etc/pam.d/login</filename> to
+      lock the account after too many failed logins. The number of
+      allowed fails is specified by <filename>/var/log/faillog</filename>
+      and needs to be set with pam_tally or <citerefentry>
+       <refentrytitle>faillog</refentrytitle><manvolnum>8</manvolnum>
+      </citerefentry> before.
+    </para>
+    <programlisting>
+auth     required       pam_securetty.so
+auth     required       pam_tally.so per_user
+auth     required       pam_env.so
+auth     required       pam_unix.so
+auth     required       pam_nologin.so
+account  required       pam_unix.so
+password required       pam_unix.so
+session  required       pam_limits.so
+session  required       pam_unix.so
+session  required       pam_lastlog.so nowtmp
+session  optional       pam_mail.so standard
+    </programlisting>
+  </refsect1>
+
+  <refsect1 id="pam_tally-files">
+    <title>FILES</title>
+    <variablelist>
+      <varlistentry>
+        <term><filename>/var/log/faillog</filename></term>
+        <listitem>
+          <para>failure logging file</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+  <refsect1 id='pam_tally-see_also'>
+    <title>SEE ALSO</title>
+    <para>
+      <citerefentry>
+       <refentrytitle>faillog</refentrytitle><manvolnum>8</manvolnum>
+      </citerefentry>,
+      <citerefentry>
+       <refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum>
+      </citerefentry>,
+      <citerefentry>
+       <refentrytitle>pam.d</refentrytitle><manvolnum>8</manvolnum>
+      </citerefentry>,
+      <citerefentry>
+       <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
+      </citerefentry>
+    </para>
+  </refsect1>
+
+  <refsect1 id='pam_tally-author'>
+    <title>AUTHOR</title>
+      <para>
+        pam_tally was written by Tim Baverstock and Tomas Mraz.
+      </para>
+  </refsect1>
+
+</refentry>