pam_limits.8.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
  4. <refentry id='pam_limits'>
  5. <refmeta>
  6. <refentrytitle>pam_limits</refentrytitle>
  7. <manvolnum>8</manvolnum>
  8. <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
  9. </refmeta>
  10. <refnamediv id='pam_limits-name'>
  11. <refname>pam_limits</refname>
  12. <refpurpose>
  13. PAM module to limit resources
  14. </refpurpose>
  15. </refnamediv>
  16. <!-- body begins here -->
  17. <refsynopsisdiv>
  18. <cmdsynopsis id="pam_limits-cmdsynopsis">
  19. <command>pam_limits.so</command>
  20. <arg choice="opt">
  21. conf=<replaceable>/path/to/limits.conf</replaceable>
  22. </arg>
  23. <arg choice="opt">
  24. debug
  25. </arg>
  26. <arg choice="opt">
  27. set_all
  28. </arg>
  29. <arg choice="opt">
  30. utmp_early
  31. </arg>
  32. <arg choice="opt">
  33. noaudit
  34. </arg>
  35. </cmdsynopsis>
  36. </refsynopsisdiv>
  37. <refsect1 id="pam_limits-description">
  38. <title>DESCRIPTION</title>
  39. <para>
  40. The pam_limits PAM module sets limits on the system resources that can be
  41. obtained in a user-session. Users of <emphasis>uid=0</emphasis> are affected
  42. by this limits, too.
  43. </para>
  44. <para>
  45. By default limits are taken from the <filename>/etc/security/limits.conf</filename>
  46. config file. Then individual *.conf files from the <filename>/etc/security/limits.d/</filename>
  47. directory are read. The files are parsed one after another in the order of "C" locale.
  48. The effect of the individual files is the same as if all the files were
  49. concatenated together in the order of parsing.
  50. If a config file is explicitly specified with a module option then the
  51. files in the above directory are not parsed.
  52. </para>
  53. <para>
  54. The module must not be called by a multithreaded application.
  55. </para>
  56. <para>
  57. If Linux PAM is compiled with audit support the module will report
  58. when it denies access based on limit of maximum number of concurrent
  59. login sessions.
  60. </para>
  61. </refsect1>
  62. <refsect1 id="pam_limits-options">
  63. <title>OPTIONS</title>
  64. <variablelist>
  65. <varlistentry>
  66. <term>
  67. <option>conf=<replaceable>/path/to/limits.conf</replaceable></option>
  68. </term>
  69. <listitem>
  70. <para>
  71. Indicate an alternative limits.conf style configuration file to
  72. override the default.
  73. </para>
  74. </listitem>
  75. </varlistentry>
  76. <varlistentry>
  77. <term>
  78. <option>debug</option>
  79. </term>
  80. <listitem>
  81. <para>
  82. Print debug information.
  83. </para>
  84. </listitem>
  85. </varlistentry>
  86. <varlistentry>
  87. <term>
  88. <option>set_all</option>
  89. </term>
  90. <listitem>
  91. <para>
  92. Set the limits for which no value is specified in the
  93. configuration file to the one from the process with the
  94. PID 1. Please note that if the init process is systemd
  95. these limits will not be the kernel default limits and
  96. this option should not be used.
  97. </para>
  98. </listitem>
  99. </varlistentry>
  100. <varlistentry>
  101. <term>
  102. <option>utmp_early</option>
  103. </term>
  104. <listitem>
  105. <para>
  106. Some broken applications actually allocate a utmp entry for
  107. the user before the user is admitted to the system. If some
  108. of the services you are configuring PAM for do this, you can
  109. selectively use this module argument to compensate for this
  110. behavior and at the same time maintain system-wide consistency
  111. with a single limits.conf file.
  112. </para>
  113. </listitem>
  114. </varlistentry>
  115. <varlistentry>
  116. <term>
  117. <option>noaudit</option>
  118. </term>
  119. <listitem>
  120. <para>
  121. Do not report exceeded maximum logins count to the audit subsystem.
  122. </para>
  123. </listitem>
  124. </varlistentry>
  125. </variablelist>
  126. </refsect1>
  127. <refsect1 id="pam_limits-types">
  128. <title>MODULE TYPES PROVIDED</title>
  129. <para>
  130. Only the <option>session</option> module type is provided.
  131. </para>
  132. </refsect1>
  133. <refsect1 id="pam_limits-return_values">
  134. <title>RETURN VALUES</title>
  135. <variablelist>
  136. <varlistentry>
  137. <term>PAM_ABORT</term>
  138. <listitem>
  139. <para>
  140. Cannot get current limits.
  141. </para>
  142. </listitem>
  143. </varlistentry>
  144. <varlistentry>
  145. <term>PAM_IGNORE</term>
  146. <listitem>
  147. <para>
  148. No limits found for this user.
  149. </para>
  150. </listitem>
  151. </varlistentry>
  152. <varlistentry>
  153. <term>PAM_PERM_DENIED</term>
  154. <listitem>
  155. <para>
  156. New limits could not be set.
  157. </para>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry>
  161. <term>PAM_SERVICE_ERR</term>
  162. <listitem>
  163. <para>
  164. Cannot read config file.
  165. </para>
  166. </listitem>
  167. </varlistentry>
  168. <varlistentry>
  169. <term>PAM_SESSION_ERR</term>
  170. <listitem>
  171. <para>
  172. Error recovering account name.
  173. </para>
  174. </listitem>
  175. </varlistentry>
  176. <varlistentry>
  177. <term>PAM_SUCCESS</term>
  178. <listitem>
  179. <para>
  180. Limits were changed.
  181. </para>
  182. </listitem>
  183. </varlistentry>
  184. <varlistentry>
  185. <term>PAM_USER_UNKNOWN</term>
  186. <listitem>
  187. <para>
  188. The user is not known to the system.
  189. </para>
  190. </listitem>
  191. </varlistentry>
  192. </variablelist>
  193. </refsect1>
  194. <refsect1 id="pam_limits-files">
  195. <title>FILES</title>
  196. <variablelist>
  197. <varlistentry>
  198. <term><filename>/etc/security/limits.conf</filename></term>
  199. <listitem>
  200. <para>Default configuration file</para>
  201. </listitem>
  202. </varlistentry>
  203. </variablelist>
  204. </refsect1>
  205. <refsect1 id='pam_limits-examples'>
  206. <title>EXAMPLES</title>
  207. <para>
  208. For the services you need resources limits (login for example) put a
  209. the following line in <filename>/etc/pam.d/login</filename> as the last
  210. line for that service (usually after the pam_unix session line):
  211. </para>
  212. <programlisting>
  213. #%PAM-1.0
  214. #
  215. # Resource limits imposed on login sessions via pam_limits
  216. #
  217. session required pam_limits.so
  218. </programlisting>
  219. <para>
  220. Replace "login" for each service you are using this module.
  221. </para>
  222. </refsect1>
  223. <refsect1 id="pam_limits-see_also">
  224. <title>SEE ALSO</title>
  225. <para>
  226. <citerefentry>
  227. <refentrytitle>limits.conf</refentrytitle><manvolnum>5</manvolnum>
  228. </citerefentry>,
  229. <citerefentry>
  230. <refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum>
  231. </citerefentry>,
  232. <citerefentry>
  233. <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
  234. </citerefentry>.
  235. </para>
  236. </refsect1>
  237. <refsect1 id="pam_limits-authors">
  238. <title>AUTHORS</title>
  239. <para>
  240. pam_limits was initially written by Cristian Gafton &lt;gafton@redhat.com&gt;
  241. </para>
  242. </refsect1>
  243. </refentry>