Blame modules/pam_lastlog/pam_lastlog.8

Packit Service b29381
'\" t
Packit Service b29381
.\"     Title: pam_lastlog
Packit Service b29381
.\"    Author: [see the "AUTHOR" section]
Packit Service b29381
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
Packit Service b29381
.\"      Date: 05/18/2017
Packit Service b29381
.\"    Manual: Linux-PAM Manual
Packit Service b29381
.\"    Source: Linux-PAM Manual
Packit Service b29381
.\"  Language: English
Packit Service b29381
.\"
Packit Service b29381
.TH "PAM_LASTLOG" "8" "05/18/2017" "Linux-PAM Manual" "Linux\-PAM Manual"
Packit Service b29381
.\" -----------------------------------------------------------------
Packit Service b29381
.\" * Define some portability stuff
Packit Service b29381
.\" -----------------------------------------------------------------
Packit Service b29381
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit Service b29381
.\" http://bugs.debian.org/507673
Packit Service b29381
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
Packit Service b29381
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit Service b29381
.ie \n(.g .ds Aq \(aq
Packit Service b29381
.el       .ds Aq '
Packit Service b29381
.\" -----------------------------------------------------------------
Packit Service b29381
.\" * set default formatting
Packit Service b29381
.\" -----------------------------------------------------------------
Packit Service b29381
.\" disable hyphenation
Packit Service b29381
.nh
Packit Service b29381
.\" disable justification (adjust text to left margin only)
Packit Service b29381
.ad l
Packit Service b29381
.\" -----------------------------------------------------------------
Packit Service b29381
.\" * MAIN CONTENT STARTS HERE *
Packit Service b29381
.\" -----------------------------------------------------------------
Packit Service b29381
.SH "NAME"
Packit Service b29381
pam_lastlog \- PAM module to display date of last login and perform inactive account lock out
Packit Service b29381
.SH "SYNOPSIS"
Packit Service b29381
.HP \w'\fBpam_lastlog\&.so\fR\ 'u
Packit Service b29381
\fBpam_lastlog\&.so\fR [debug] [silent] [never] [nodate] [nohost] [noterm] [nowtmp] [noupdate] [showfailed] [inactive=<days>]
Packit Service b29381
.SH "DESCRIPTION"
Packit Service b29381
.PP
Packit Service b29381
pam_lastlog is a PAM module to display a line of information about the last login of the user\&. In addition, the module maintains the
Packit Service b29381
/var/log/lastlog
Packit Service b29381
file\&.
Packit Service b29381
.PP
Packit Service b29381
Some applications may perform this function themselves\&. In such cases, this module is not necessary\&.
Packit Service b29381
.PP
Packit Service b29381
If the module is called in the auth or account phase, the accounts that were not used recently enough will be disallowed to log in\&. The check is not performed for the root account so the root is never locked out\&.
Packit Service b29381
.SH "OPTIONS"
Packit Service b29381
.PP
Packit Service b29381
\fBdebug\fR
Packit Service b29381
.RS 4
Packit Service b29381
Print debug information\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBsilent\fR
Packit Service b29381
.RS 4
Packit Service b29381
Don\*(Aqt inform the user about any previous login, just update the
Packit Service b29381
/var/log/lastlog
Packit Service b29381
file\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBnever\fR
Packit Service b29381
.RS 4
Packit Service b29381
If the
Packit Service b29381
/var/log/lastlog
Packit Service b29381
file does not contain any old entries for the user, indicate that the user has never previously logged in with a welcome message\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBnodate\fR
Packit Service b29381
.RS 4
Packit Service b29381
Don\*(Aqt display the date of the last login\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBnoterm\fR
Packit Service b29381
.RS 4
Packit Service b29381
Don\*(Aqt display the terminal name on which the last login was attempted\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBnohost\fR
Packit Service b29381
.RS 4
Packit Service b29381
Don\*(Aqt indicate from which host the last login was attempted\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBnowtmp\fR
Packit Service b29381
.RS 4
Packit Service b29381
Don\*(Aqt update the wtmp entry\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBnoupdate\fR
Packit Service b29381
.RS 4
Packit Service b29381
Don\*(Aqt update any file\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBshowfailed\fR
Packit Service b29381
.RS 4
Packit Service b29381
Display number of failed login attempts and the date of the last failed attempt from btmp\&. The date is not displayed when
Packit Service b29381
\fBnodate\fR
Packit Service b29381
is specified\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
\fBinactive=<days>\fR
Packit Service b29381
.RS 4
Packit Service b29381
This option is specific for the auth or account phase\&. It specifies the number of days after the last login of the user when the user will be locked out by the module\&. The default value is 90\&.
Packit Service b29381
.RE
Packit Service b29381
.SH "MODULE TYPES PROVIDED"
Packit Service b29381
.PP
Packit Service b29381
The
Packit Service b29381
\fBauth\fR
Packit Service b29381
and
Packit Service b29381
\fBaccount\fR
Packit Service b29381
module type allows to lock out users which did not login recently enough\&. The
Packit Service b29381
\fBsession\fR
Packit Service b29381
module type is provided for displaying the information about the last login and/or updating the lastlog and wtmp files\&.
Packit Service b29381
.SH "RETURN VALUES"
Packit Service b29381
.PP
Packit Service b29381
.PP
Packit Service b29381
PAM_SUCCESS
Packit Service b29381
.RS 4
Packit Service b29381
Everything was successful\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
PAM_SERVICE_ERR
Packit Service b29381
.RS 4
Packit Service b29381
Internal service module error\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
PAM_USER_UNKNOWN
Packit Service b29381
.RS 4
Packit Service b29381
User not known\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
PAM_AUTH_ERR
Packit Service b29381
.RS 4
Packit Service b29381
User locked out in the auth or account phase due to inactivity\&.
Packit Service b29381
.RE
Packit Service b29381
.PP
Packit Service b29381
PAM_IGNORE
Packit Service b29381
.RS 4
Packit Service b29381
There was an error during reading the lastlog file in the auth or account phase and thus inactivity of the user cannot be determined\&.
Packit Service b29381
.RE
Packit Service b29381
.SH "EXAMPLES"
Packit Service b29381
.PP
Packit Service b29381
Add the following line to
Packit Service b29381
/etc/pam\&.d/login
Packit Service b29381
to display the last login time of an user:
Packit Service b29381
.sp
Packit Service b29381
.if n \{\
Packit Service b29381
.RS 4
Packit Service b29381
.\}
Packit Service b29381
.nf
Packit Service b29381
    session  required  pam_lastlog\&.so nowtmp
Packit Service b29381
      
Packit Service b29381
.fi
Packit Service b29381
.if n \{\
Packit Service b29381
.RE
Packit Service b29381
.\}
Packit Service b29381
.PP
Packit Service b29381
To reject the user if he did not login during the previous 50 days the following line can be used:
Packit Service b29381
.sp
Packit Service b29381
.if n \{\
Packit Service b29381
.RS 4
Packit Service b29381
.\}
Packit Service b29381
.nf
Packit Service b29381
    auth  required  pam_lastlog\&.so inactive=50
Packit Service b29381
      
Packit Service b29381
.fi
Packit Service b29381
.if n \{\
Packit Service b29381
.RE
Packit Service b29381
.\}
Packit Service b29381
.SH "FILES"
Packit Service b29381
.PP
Packit Service b29381
/var/log/lastlog
Packit Service b29381
.RS 4
Packit Service b29381
Lastlog logging file
Packit Service b29381
.RE
Packit Service b29381
.SH "SEE ALSO"
Packit Service b29381
.PP
Packit Service b29381
\fBpam.conf\fR(5),
Packit Service b29381
\fBpam.d\fR(5),
Packit Service b29381
\fBpam\fR(8)
Packit Service b29381
.SH "AUTHOR"
Packit Service b29381
.PP
Packit Service b29381
pam_lastlog was written by Andrew G\&. Morgan <morgan@kernel\&.org>\&.
Packit Service b29381
.PP
Packit Service b29381
Inactive account lock out added by Tomáš Mráz <tm@t8m\&.info>\&.