pam_lastlog.8.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <?xml version="1.0" encoding='UTF-8'?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
  4. <refentry id="pam_lastlog">
  5. <refmeta>
  6. <refentrytitle>pam_lastlog</refentrytitle>
  7. <manvolnum>8</manvolnum>
  8. <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id="pam_lastlog-name">
  11. <refname>pam_lastlog</refname>
  12. <refpurpose>PAM module to display date of last login and perform inactive account lock out</refpurpose>
  13. </refnamediv>
  14. <refsynopsisdiv>
  15. <cmdsynopsis id="pam_lastlog-cmdsynopsis">
  16. <command>pam_lastlog.so</command>
  17. <arg choice="opt">
  18. debug
  19. </arg>
  20. <arg choice="opt">
  21. silent
  22. </arg>
  23. <arg choice="opt">
  24. never
  25. </arg>
  26. <arg choice="opt">
  27. nodate
  28. </arg>
  29. <arg choice="opt">
  30. nohost
  31. </arg>
  32. <arg choice="opt">
  33. noterm
  34. </arg>
  35. <arg choice="opt">
  36. nowtmp
  37. </arg>
  38. <arg choice="opt">
  39. noupdate
  40. </arg>
  41. <arg choice="opt">
  42. showfailed
  43. </arg>
  44. <arg choice="opt">
  45. inactive=&lt;days&gt;
  46. </arg>
  47. <arg choice="opt">
  48. unlimited
  49. </arg>
  50. </cmdsynopsis>
  51. </refsynopsisdiv>
  52. <refsect1 id="pam_lastlog-description">
  53. <title>DESCRIPTION</title>
  54. <para>
  55. pam_lastlog is a PAM module to display a line of information
  56. about the last login of the user. In addition, the module maintains
  57. the <filename>/var/log/lastlog</filename> file.
  58. </para>
  59. <para>
  60. Some applications may perform this function themselves. In such
  61. cases, this module is not necessary.
  62. </para>
  63. <para>
  64. The module checks <option>LASTLOG_UID_MAX</option> option in
  65. <filename>/etc/login.defs</filename> and does not update or display
  66. last login records for users with UID higher than its value.
  67. If the option is not present or its value is invalid, no user ID
  68. limit is applied.
  69. </para>
  70. <para>
  71. If the module is called in the auth or account phase, the accounts that
  72. were not used recently enough will be disallowed to log in. The
  73. check is not performed for the root account so the root is never
  74. locked out. It is also not performed for users with UID higher
  75. than the <option>LASTLOG_UID_MAX</option> value.
  76. </para>
  77. </refsect1>
  78. <refsect1 id="pam_lastlog-options">
  79. <title>OPTIONS</title>
  80. <variablelist>
  81. <varlistentry>
  82. <term>
  83. <option>debug</option>
  84. </term>
  85. <listitem>
  86. <para>
  87. Print debug information.
  88. </para>
  89. </listitem>
  90. </varlistentry>
  91. <varlistentry>
  92. <term>
  93. <option>silent</option>
  94. </term>
  95. <listitem>
  96. <para>
  97. Don't inform the user about any previous login,
  98. just update the <filename>/var/log/lastlog</filename> file.
  99. This option does not affect display of bad login attempts.
  100. </para>
  101. </listitem>
  102. </varlistentry>
  103. <varlistentry>
  104. <term>
  105. <option>never</option>
  106. </term>
  107. <listitem>
  108. <para>
  109. If the <filename>/var/log/lastlog</filename> file does
  110. not contain any old entries for the user, indicate that
  111. the user has never previously logged in with a welcome
  112. message.
  113. </para>
  114. </listitem>
  115. </varlistentry>
  116. <varlistentry>
  117. <term>
  118. <option>nodate</option>
  119. </term>
  120. <listitem>
  121. <para>
  122. Don't display the date of the last login.
  123. </para>
  124. </listitem>
  125. </varlistentry>
  126. <varlistentry>
  127. <term>
  128. <option>noterm</option>
  129. </term>
  130. <listitem>
  131. <para>
  132. Don't display the terminal name on which the
  133. last login was attempted.
  134. </para>
  135. </listitem>
  136. </varlistentry>
  137. <varlistentry>
  138. <term>
  139. <option>nohost</option>
  140. </term>
  141. <listitem>
  142. <para>
  143. Don't indicate from which host the last login was
  144. attempted.
  145. </para>
  146. </listitem>
  147. </varlistentry>
  148. <varlistentry>
  149. <term>
  150. <option>nowtmp</option>
  151. </term>
  152. <listitem>
  153. <para>
  154. Don't update the wtmp entry.
  155. </para>
  156. </listitem>
  157. </varlistentry>
  158. <varlistentry>
  159. <term>
  160. <option>noupdate</option>
  161. </term>
  162. <listitem>
  163. <para>
  164. Don't update any file.
  165. </para>
  166. </listitem>
  167. </varlistentry>
  168. <varlistentry>
  169. <term>
  170. <option>showfailed</option>
  171. </term>
  172. <listitem>
  173. <para>
  174. Display number of failed login attempts and the date of the
  175. last failed attempt from btmp. The date is not displayed
  176. when <option>nodate</option> is specified.
  177. </para>
  178. </listitem>
  179. </varlistentry>
  180. <varlistentry>
  181. <term>
  182. <option>inactive=&lt;days&gt;</option>
  183. </term>
  184. <listitem>
  185. <para>
  186. This option is specific for the auth or account phase. It
  187. specifies the number of days after the last login of the user
  188. when the user will be locked out by the module. The default
  189. value is 90.
  190. </para>
  191. </listitem>
  192. </varlistentry>
  193. <varlistentry>
  194. <term>
  195. <option>unlimited</option>
  196. </term>
  197. <listitem>
  198. <para>
  199. If the <emphasis>fsize</emphasis> limit is set, this option can be
  200. used to override it, preventing failures on systems with large UID
  201. values that lead lastlog to become a huge sparse file.
  202. </para>
  203. </listitem>
  204. </varlistentry>
  205. </variablelist>
  206. </refsect1>
  207. <refsect1 id="pam_lastlog-types">
  208. <title>MODULE TYPES PROVIDED</title>
  209. <para>
  210. The <option>auth</option> and <option>account</option> module type
  211. allows one to lock out users who did not login recently enough.
  212. The <option>session</option> module type is provided for displaying
  213. the information about the last login and/or updating the lastlog and
  214. wtmp files.
  215. </para>
  216. </refsect1>
  217. <refsect1 id='pam_lastlog-return_values'>
  218. <title>RETURN VALUES</title>
  219. <para>
  220. <variablelist>
  221. <varlistentry>
  222. <term>PAM_SUCCESS</term>
  223. <listitem>
  224. <para>
  225. Everything was successful.
  226. </para>
  227. </listitem>
  228. </varlistentry>
  229. <varlistentry>
  230. <term>PAM_SERVICE_ERR</term>
  231. <listitem>
  232. <para>
  233. Internal service module error.
  234. </para>
  235. </listitem>
  236. </varlistentry>
  237. <varlistentry>
  238. <term>PAM_USER_UNKNOWN</term>
  239. <listitem>
  240. <para>
  241. User not known.
  242. </para>
  243. </listitem>
  244. </varlistentry>
  245. <varlistentry>
  246. <term>PAM_AUTH_ERR</term>
  247. <listitem>
  248. <para>
  249. User locked out in the auth or account phase due to
  250. inactivity.
  251. </para>
  252. </listitem>
  253. </varlistentry>
  254. <varlistentry>
  255. <term>PAM_IGNORE</term>
  256. <listitem>
  257. <para>
  258. There was an error during reading the lastlog file
  259. in the auth or account phase and thus inactivity
  260. of the user cannot be determined.
  261. </para>
  262. </listitem>
  263. </varlistentry>
  264. </variablelist>
  265. </para>
  266. </refsect1>
  267. <refsect1 id='pam_lastlog-examples'>
  268. <title>EXAMPLES</title>
  269. <para>
  270. Add the following line to <filename>/etc/pam.d/login</filename> to
  271. display the last login time of a user:
  272. </para>
  273. <programlisting>
  274. session required pam_lastlog.so nowtmp
  275. </programlisting>
  276. <para>
  277. To reject the user if he did not login during the previous 50 days
  278. the following line can be used:
  279. </para>
  280. <programlisting>
  281. auth required pam_lastlog.so inactive=50
  282. </programlisting>
  283. </refsect1>
  284. <refsect1 id="pam_lastlog-files">
  285. <title>FILES</title>
  286. <variablelist>
  287. <varlistentry>
  288. <term><filename>/var/log/lastlog</filename></term>
  289. <listitem>
  290. <para>Lastlog logging file</para>
  291. </listitem>
  292. </varlistentry>
  293. </variablelist>
  294. </refsect1>
  295. <refsect1 id='pam_lastlog-see_also'>
  296. <title>SEE ALSO</title>
  297. <para>
  298. <citerefentry>
  299. <refentrytitle>limits.conf</refentrytitle><manvolnum>5</manvolnum>
  300. </citerefentry>,
  301. <citerefentry>
  302. <refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum>
  303. </citerefentry>,
  304. <citerefentry>
  305. <refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum>
  306. </citerefentry>,
  307. <citerefentry>
  308. <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
  309. </citerefentry>
  310. </para>
  311. </refsect1>
  312. <refsect1 id='pam_lastlog-author'>
  313. <title>AUTHOR</title>
  314. <para>
  315. pam_lastlog was written by Andrew G. Morgan &lt;morgan@kernel.org&gt;.
  316. </para>
  317. <para>
  318. Inactive account lock out added by Tomáš Mráz &lt;tm@t8m.info&gt;.
  319. </para>
  320. </refsect1>
  321. </refentry>