summaryrefslogtreecommitdiff
path: root/modules/pam_lastlog/pam_lastlog.8
blob: 738bd1eb1d1e259321ee474dd5904d928d30d9c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
'\" t
.\"     Title: pam_lastlog
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 05/18/2017
.\"    Manual: Linux-PAM Manual
.\"    Source: Linux-PAM Manual
.\"  Language: English
.\"
.TH "PAM_LASTLOG" "8" "05/18/2017" "Linux-PAM Manual" "Linux\-PAM Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
pam_lastlog \- PAM module to display date of last login and perform inactive account lock out
.SH "SYNOPSIS"
.HP \w'\fBpam_lastlog\&.so\fR\ 'u
\fBpam_lastlog\&.so\fR [debug] [silent] [never] [nodate] [nohost] [noterm] [nowtmp] [noupdate] [showfailed] [inactive=<days>]
.SH "DESCRIPTION"
.PP
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
/var/log/lastlog
file\&.
.PP
Some applications may perform this function themselves\&. In such cases, this module is not necessary\&.
.PP
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\&.
.SH "OPTIONS"
.PP
\fBdebug\fR
.RS 4
Print debug information\&.
.RE
.PP
\fBsilent\fR
.RS 4
Don\*(Aqt inform the user about any previous login, just update the
/var/log/lastlog
file\&.
.RE
.PP
\fBnever\fR
.RS 4
If the
/var/log/lastlog
file does not contain any old entries for the user, indicate that the user has never previously logged in with a welcome message\&.
.RE
.PP
\fBnodate\fR
.RS 4
Don\*(Aqt display the date of the last login\&.
.RE
.PP
\fBnoterm\fR
.RS 4
Don\*(Aqt display the terminal name on which the last login was attempted\&.
.RE
.PP
\fBnohost\fR
.RS 4
Don\*(Aqt indicate from which host the last login was attempted\&.
.RE
.PP
\fBnowtmp\fR
.RS 4
Don\*(Aqt update the wtmp entry\&.
.RE
.PP
\fBnoupdate\fR
.RS 4
Don\*(Aqt update any file\&.
.RE
.PP
\fBshowfailed\fR
.RS 4
Display number of failed login attempts and the date of the last failed attempt from btmp\&. The date is not displayed when
\fBnodate\fR
is specified\&.
.RE
.PP
\fBinactive=<days>\fR
.RS 4
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\&.
.RE
.SH "MODULE TYPES PROVIDED"
.PP
The
\fBauth\fR
and
\fBaccount\fR
module type allows to lock out users which did not login recently enough\&. The
\fBsession\fR
module type is provided for displaying the information about the last login and/or updating the lastlog and wtmp files\&.
.SH "RETURN VALUES"
.PP
.PP
PAM_SUCCESS
.RS 4
Everything was successful\&.
.RE
.PP
PAM_SERVICE_ERR
.RS 4
Internal service module error\&.
.RE
.PP
PAM_USER_UNKNOWN
.RS 4
User not known\&.
.RE
.PP
PAM_AUTH_ERR
.RS 4
User locked out in the auth or account phase due to inactivity\&.
.RE
.PP
PAM_IGNORE
.RS 4
There was an error during reading the lastlog file in the auth or account phase and thus inactivity of the user cannot be determined\&.
.RE
.SH "EXAMPLES"
.PP
Add the following line to
/etc/pam\&.d/login
to display the last login time of an user:
.sp
.if n \{\
.RS 4
.\}
.nf
    session  required  pam_lastlog\&.so nowtmp
      
.fi
.if n \{\
.RE
.\}
.PP
To reject the user if he did not login during the previous 50 days the following line can be used:
.sp
.if n \{\
.RS 4
.\}
.nf
    auth  required  pam_lastlog\&.so inactive=50
      
.fi
.if n \{\
.RE
.\}
.SH "FILES"
.PP
/var/log/lastlog
.RS 4
Lastlog logging file
.RE
.SH "SEE ALSO"
.PP
\fBpam.conf\fR(5),
\fBpam.d\fR(5),
\fBpam\fR(8)
.SH "AUTHOR"
.PP
pam_lastlog was written by Andrew G\&. Morgan <morgan@kernel\&.org>\&.
.PP
Inactive account lock out added by Tomáš Mráz <tm@t8m\&.info>\&.