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

NAME

6       pam_lastlog - PAM module to display date of last login and perform
7       inactive account lock out
8

SYNOPSIS

10       pam_lastlog.so [debug] [silent] [never] [nodate] [nohost] [noterm]
11                      [nowtmp] [noupdate] [showfailed] [inactive=<days>]
12                      [unlimited]
13

DESCRIPTION

15       pam_lastlog is a PAM module to display a line of information about the
16       last login of the user. In addition, the module maintains the
17       /var/log/lastlog file.
18
19       Some applications may perform this function themselves. In such cases,
20       this module is not necessary.
21
22       The module checks LASTLOG_UID_MAX option in /etc/login.defs and does
23       not update or display last login records for users with UID higher than
24       its value. If the option is not present or its value is invalid, no
25       user ID limit is applied.
26
27       If the module is called in the auth or account phase, the accounts that
28       were not used recently enough will be disallowed to log in. The check
29       is not performed for the root account so the root is never locked out.
30       It is also not performed for users with UID higher than the
31       LASTLOG_UID_MAX value.
32

OPTIONS

34       debug
35           Print debug information.
36
37       silent
38           Don't inform the user about any previous login, just update the
39           /var/log/lastlog file. This option does not affect display of bad
40           login attempts.
41
42       never
43           If the /var/log/lastlog file does not contain any old entries for
44           the user, indicate that the user has never previously logged in
45           with a welcome message.
46
47       nodate
48           Don't display the date of the last login.
49
50       noterm
51           Don't display the terminal name on which the last login was
52           attempted.
53
54       nohost
55           Don't indicate from which host the last login was attempted.
56
57       nowtmp
58           Don't update the wtmp entry.
59
60       noupdate
61           Don't update any file.
62
63       showfailed
64           Display number of failed login attempts and the date of the last
65           failed attempt from btmp. The date is not displayed when nodate is
66           specified.
67
68       inactive=<days>
69           This option is specific for the auth or account phase. It specifies
70           the number of days after the last login of the user when the user
71           will be locked out by the module. The default value is 90.
72
73       unlimited
74           If the fsize limit is set, this option can be used to override it,
75           preventing failures on systems with large UID values that lead
76           lastlog to become a huge sparse file.
77

MODULE TYPES PROVIDED

79       The auth and account module type allows one to lock out users who did
80       not login recently enough. The session module type is provided for
81       displaying the information about the last login and/or updating the
82       lastlog and wtmp files.
83

RETURN VALUES

85       PAM_SUCCESS
86           Everything was successful.
87
88       PAM_SERVICE_ERR
89           Internal service module error.
90
91       PAM_USER_UNKNOWN
92           User not known.
93
94       PAM_AUTH_ERR
95           User locked out in the auth or account phase due to inactivity.
96
97       PAM_IGNORE
98           There was an error during reading the lastlog file in the auth or
99           account phase and thus inactivity of the user cannot be determined.
100

EXAMPLES

102       Add the following line to /etc/pam.d/login to display the last login
103       time of an user:
104
105               session  required  pam_lastlog.so nowtmp
106
107
108       To reject the user if he did not login during the previous 50 days the
109       following line can be used:
110
111               auth  required  pam_lastlog.so inactive=50
112
113

FILES

115       /var/log/lastlog
116           Lastlog logging file
117

SEE ALSO

119       limits.conf(5), pam.conf(5), pam.d(5), pam(8)
120

AUTHOR

122       pam_lastlog was written by Andrew G. Morgan <morgan@kernel.org>.
123
124       Inactive account lock out added by Tomáš Mráz <tm@t8m.info>.
125
126
127
128Linux-PAM Manual                  06/08/2020                    PAM_LASTLOG(8)
Impressum