pam_lastlog.8 5.2 KB

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