pam_setquota.8.xml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <?xml version="1.0" encoding='UTF-8'?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
  3. <refentry id="pam_setquota">
  4. <refmeta>
  5. <refentrytitle>pam_setquota</refentrytitle>
  6. <manvolnum>8</manvolnum>
  7. <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo>
  8. </refmeta>
  9. <refnamediv id="pam_setquota-name">
  10. <refname>pam_setquota</refname>
  11. <refpurpose>PAM module to set or modify disk quotas on session start</refpurpose>
  12. </refnamediv>
  13. <refsynopsisdiv>
  14. <cmdsynopsis id="pam_setquota-cmdsynopsis">
  15. <command>pam_setquota.so</command>
  16. <arg choice="opt">
  17. fs=<replaceable>/home</replaceable>
  18. </arg>
  19. <arg choice="opt">
  20. overwrite=<replaceable>0</replaceable>
  21. </arg>
  22. <arg choice="opt">
  23. debug=<replaceable>0</replaceable>
  24. </arg>
  25. <arg choice="opt">
  26. startuid=<replaceable>1000</replaceable>
  27. </arg>
  28. <arg choice="opt">
  29. enduid=<replaceable>0</replaceable>
  30. </arg>
  31. <arg choice="opt">
  32. bsoftlimit=<replaceable>19000</replaceable>
  33. </arg>
  34. <arg choice="opt">
  35. bhardlimit=<replaceable>20000</replaceable>
  36. </arg>
  37. <arg choice="opt">
  38. isoftlimit=<replaceable>3000</replaceable>
  39. </arg>
  40. <arg choice="opt">
  41. ihardlimit=<replaceable>4000</replaceable>
  42. </arg>
  43. </cmdsynopsis>
  44. </refsynopsisdiv>
  45. <refsect1 id="pam_setquota-description">
  46. <title>DESCRIPTION</title>
  47. <para>
  48. pam_setquota is a PAM module to set or modify a disk quota at session start
  49. </para>
  50. <para>
  51. This makes quotas usable with central user databases, such as MySQL or LDAP.
  52. </para>
  53. </refsect1>
  54. <refsect1 id="pam_setquota-options">
  55. <title>OPTIONS</title>
  56. <para>
  57. <variablelist>
  58. <varlistentry>
  59. <term>
  60. <option>fs=<replaceable>/home</replaceable></option>
  61. </term>
  62. <listitem>
  63. <para>
  64. The device file or mountpoint the policy applies to. Defaults to the
  65. filesystem containing the users home directory.
  66. </para>
  67. </listitem>
  68. </varlistentry>
  69. <varlistentry>
  70. <term>
  71. <option>overwrite=<replaceable>0</replaceable></option>
  72. </term>
  73. <listitem>
  74. <para>
  75. Overwrite an existing quota. Note: Enabling this will remove the ability
  76. for the admin to manually configure different quotas for users for a
  77. filesystem with <citerefentry><refentrytitle>edquota</refentrytitle>
  78. <manvolnum>8</manvolnum></citerefentry>. (Defaults to 0)
  79. </para>
  80. </listitem>
  81. </varlistentry>
  82. <varlistentry>
  83. <term>
  84. <option>debug=<replaceable>0</replaceable></option>
  85. </term>
  86. <listitem>
  87. <para>
  88. Enable debugging. A value of 1 outputs the old and new quota on a device.
  89. A value of 2 also prints out the matched and found filesystems should
  90. <option>fs</option> be unset. (Defaults to 0)
  91. </para>
  92. </listitem>
  93. </varlistentry>
  94. <varlistentry>
  95. <term>
  96. <option>startuid=<replaceable>1000</replaceable></option>
  97. </term>
  98. <listitem>
  99. <para>
  100. Describe the start of the UID range the policy is applied to.
  101. (Defaults to UID_MIN from login.defs or the uidmin value defined
  102. at compile-time if UID_MIN is undefined.)
  103. </para>
  104. </listitem>
  105. </varlistentry>
  106. <varlistentry>
  107. <term>
  108. <option>enduid=<replaceable>0</replaceable></option>
  109. </term>
  110. <listitem>
  111. <para>
  112. Describe the end of the UID range the policy is applied to. Setting
  113. <emphasis>enduid=0</emphasis> results in an open-ended UID
  114. range (i.e. all uids greater than <option>startuid</option> are
  115. included). (Defaults to 0)
  116. </para>
  117. </listitem>
  118. </varlistentry>
  119. <varlistentry>
  120. <term>
  121. <option>bsoftlimit=<replaceable>19000</replaceable></option>
  122. </term>
  123. <listitem>
  124. <para>
  125. Soft limit for disk quota blocks, as defined by <citerefentry>
  126. <refentrytitle>quotactl</refentrytitle><manvolnum>2</manvolnum>
  127. </citerefentry>.
  128. Note: <option>bsoftlimit</option> and <option>bhardlimit</option>
  129. <emphasis>must</emphasis> be set at the same time!
  130. </para>
  131. </listitem>
  132. </varlistentry>
  133. <varlistentry>
  134. <term>
  135. <option>bhardlimit=<replaceable>20000</replaceable></option>
  136. </term>
  137. <listitem>
  138. <para>
  139. Hard limit for disk quota blocks, as defined by <citerefentry>
  140. <refentrytitle>quotactl</refentrytitle><manvolnum>2</manvolnum>
  141. </citerefentry>.
  142. Note: <option>bsoftlimit</option> and <option>bhardlimit</option>
  143. <emphasis>must</emphasis> be set at the same time!
  144. </para>
  145. </listitem>
  146. </varlistentry>
  147. <varlistentry>
  148. <term>
  149. <option>isoftlimit=<replaceable>3000</replaceable></option>
  150. </term>
  151. <listitem>
  152. <para>
  153. Soft limit for inodes, as defined by <citerefentry><refentrytitle>
  154. quotactl</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
  155. Note: <option>isoftlimit</option> and <option>ihardlimit</option>
  156. <emphasis>must</emphasis> be set at the same time!
  157. </para>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry>
  161. <term>
  162. <option>ihardlimit=<replaceable>4000</replaceable></option>
  163. </term>
  164. <listitem>
  165. <para>
  166. Hard limit for inodes, as defined by <citerefentry><refentrytitle>
  167. quotactl</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
  168. Note: <option>isoftlimit</option> and <option>ihardlimit</option>
  169. <emphasis>must</emphasis> be set at the same time!
  170. </para>
  171. </listitem>
  172. </varlistentry>
  173. </variablelist>
  174. </para>
  175. </refsect1>
  176. <refsect1 id="pam_setquota-types">
  177. <title>MODULE TYPES PROVIDED</title>
  178. <para>
  179. Only the <option>session</option> module type is provided.
  180. </para>
  181. </refsect1>
  182. <refsect1 id='pam_setquota-return_values'>
  183. <title>RETURN VALUES</title>
  184. <para>
  185. <variablelist>
  186. <varlistentry>
  187. <term>PAM_SUCCESS</term>
  188. <listitem>
  189. <para>
  190. The quota was set successfully.
  191. </para>
  192. </listitem>
  193. </varlistentry>
  194. <varlistentry>
  195. <term>PAM_IGNORE</term>
  196. <listitem>
  197. <para>
  198. No action was taken because either the UID of the user was outside
  199. of the specified range, a quota already existed and
  200. <option>overwrite=1</option> was not configured or no limits were
  201. configured at all.
  202. </para>
  203. </listitem>
  204. </varlistentry>
  205. <varlistentry>
  206. <term>PAM_USER_UNKNOWN</term>
  207. <listitem>
  208. <para>
  209. The user was not found.
  210. </para>
  211. </listitem>
  212. </varlistentry>
  213. <varlistentry>
  214. <term>PAM_PERM_DENIED</term>
  215. <listitem>
  216. <para>
  217. <filename>/proc/mounts</filename> could not be opened.
  218. </para>
  219. <para>
  220. The filesystem or device specified was not found.
  221. </para>
  222. <para>
  223. The limits for the user could not be retrieved. See syslog for
  224. more information.
  225. </para>
  226. <para>
  227. The limits for the user could not be set. See syslog for
  228. more information.
  229. </para>
  230. <para>
  231. Either <option>isoftlimit</option>/<option>ihardlimit</option>
  232. or <option>bsoftlimit</option>/<option>bhardlimit</option> were
  233. not set at the same time.
  234. </para>
  235. </listitem>
  236. </varlistentry>
  237. </variablelist>
  238. </para>
  239. </refsect1>
  240. <refsect1 id='pam_setquota-examples'>
  241. <title>EXAMPLES</title>
  242. <para>
  243. A single invocation of `pam_setquota` applies a specific policy to a UID
  244. range. Applying different policies to specific UID ranges is done by
  245. invoking pam_setquota more than once. The last matching entry
  246. defines the resulting quota.
  247. <programlisting>
  248. session required pam_setquota.so bsoftlimit=1000 bhardlimit=2000 isoftlimit=1000 ihardlimit=2000 startuid=1000 enduid=0 fs=/home
  249. session required pam_setquota.so bsoftlimit=19000 bhardlimit=20000 isoftlimit=3000 ihardlimit=4000 startuid=2001 enduid=3000 fs=/dev/sda1
  250. session required pam_setquota.so bsoftlimit=19000 bhardlimit=20000 isoftlimit=3000 ihardlimit=4000 startuid=3001 enduid=4000 fs=/dev/sda1 overwrite=1
  251. </programlisting>
  252. </para>
  253. </refsect1>
  254. <refsect1 id='pam_setquota-see_also'>
  255. <title>SEE ALSO</title>
  256. <para>
  257. <citerefentry>
  258. <refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum>
  259. </citerefentry>,
  260. <citerefentry>
  261. <refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum>
  262. </citerefentry>,
  263. <citerefentry>
  264. <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
  265. </citerefentry>
  266. </para>
  267. </refsect1>
  268. <refsect1 id='pam_setquota-author'>
  269. <title>AUTHOR</title>
  270. <para>
  271. pam_setquota was originally written by
  272. Ruslan Savchenko &lt;savrus@mexmat.net&gt;.
  273. </para>
  274. <para>
  275. Further modifications were made by Shane Tzen &lt;shane@ict.usc.edu&gt;,
  276. Sven Hartge &lt;sven@svenhartge.de&gt;
  277. and Keller Fuchs &lt;kellerfuchs@hashbang.sh&gt;.
  278. </para>
  279. </refsect1>
  280. </refentry>