pam_setquota.8 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. '\" t
  2. .\" Title: pam_setquota
  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_SETQUOTA" "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_setquota \- PAM module to set or modify disk quotas on session start
  32. .SH "SYNOPSIS"
  33. .HP \w'\fBpam_setquota\&.so\fR\ 'u
  34. \fBpam_setquota\&.so\fR [fs=\fI/home\fR] [overwrite=\fI0\fR] [debug=\fI0\fR] [startuid=\fI1000\fR] [enduid=\fI0\fR] [bsoftlimit=\fI19000\fR] [bhardlimit=\fI20000\fR] [isoftlimit=\fI3000\fR] [ihardlimit=\fI4000\fR]
  35. .SH "DESCRIPTION"
  36. .PP
  37. pam_setquota is a PAM module to set or modify a disk quota at session start
  38. .PP
  39. This makes quotas usable with central user databases, such as MySQL or LDAP\&.
  40. .SH "OPTIONS"
  41. .PP
  42. .PP
  43. \fBfs=\fR\fB\fI/home\fR\fR
  44. .RS 4
  45. The device file or mountpoint the policy applies to\&. Defaults to the filesystem containing the users home directory\&.
  46. .RE
  47. .PP
  48. \fBoverwrite=\fR\fB\fI0\fR\fR
  49. .RS 4
  50. Overwrite an existing quota\&. Note: Enabling this will remove the ability for the admin to manually configure different quotas for users for a filesystem with
  51. \fBedquota\fR(8)\&. (Defaults to 0)
  52. .RE
  53. .PP
  54. \fBdebug=\fR\fB\fI0\fR\fR
  55. .RS 4
  56. Enable debugging\&. A value of 1 outputs the old and new quota on a device\&. A value of 2 also prints out the matched and found filesystems should
  57. \fBfs\fR
  58. be unset\&. (Defaults to 0)
  59. .RE
  60. .PP
  61. \fBstartuid=\fR\fB\fI1000\fR\fR
  62. .RS 4
  63. Describe the start of the UID range the policy is applied to\&. (Defaults to UID_MIN from login\&.defs or the uidmin value defined at compile\-time if UID_MIN is undefined\&.)
  64. .RE
  65. .PP
  66. \fBenduid=\fR\fB\fI0\fR\fR
  67. .RS 4
  68. Describe the end of the UID range the policy is applied to\&. Setting
  69. \fIenduid=0\fR
  70. results in an open\-ended UID range (i\&.e\&. all uids greater than
  71. \fBstartuid\fR
  72. are included)\&. (Defaults to 0)
  73. .RE
  74. .PP
  75. \fBbsoftlimit=\fR\fB\fI19000\fR\fR
  76. .RS 4
  77. Soft limit for disk quota blocks, as defined by
  78. \fBquotactl\fR(2)\&. Note:
  79. \fBbsoftlimit\fR
  80. and
  81. \fBbhardlimit\fR
  82. \fImust\fR
  83. be set at the same time!
  84. .RE
  85. .PP
  86. \fBbhardlimit=\fR\fB\fI20000\fR\fR
  87. .RS 4
  88. Hard limit for disk quota blocks, as defined by
  89. \fBquotactl\fR(2)\&. Note:
  90. \fBbsoftlimit\fR
  91. and
  92. \fBbhardlimit\fR
  93. \fImust\fR
  94. be set at the same time!
  95. .RE
  96. .PP
  97. \fBisoftlimit=\fR\fB\fI3000\fR\fR
  98. .RS 4
  99. Soft limit for inodes, as defined by
  100. \fB quotactl\fR(2)\&. Note:
  101. \fBisoftlimit\fR
  102. and
  103. \fBihardlimit\fR
  104. \fImust\fR
  105. be set at the same time!
  106. .RE
  107. .PP
  108. \fBihardlimit=\fR\fB\fI4000\fR\fR
  109. .RS 4
  110. Hard limit for inodes, as defined by
  111. \fB quotactl\fR(2)\&. Note:
  112. \fBisoftlimit\fR
  113. and
  114. \fBihardlimit\fR
  115. \fImust\fR
  116. be set at the same time!
  117. .RE
  118. .SH "MODULE TYPES PROVIDED"
  119. .PP
  120. Only the
  121. \fBsession\fR
  122. module type is provided\&.
  123. .SH "RETURN VALUES"
  124. .PP
  125. .PP
  126. PAM_SUCCESS
  127. .RS 4
  128. The quota was set successfully\&.
  129. .RE
  130. .PP
  131. PAM_IGNORE
  132. .RS 4
  133. No action was taken because either the UID of the user was outside of the specified range, a quota already existed and
  134. \fBoverwrite=1\fR
  135. was not configured or no limits were configured at all\&.
  136. .RE
  137. .PP
  138. PAM_USER_UNKNOWN
  139. .RS 4
  140. The user was not found\&.
  141. .RE
  142. .PP
  143. PAM_PERM_DENIED
  144. .RS 4
  145. /proc/mounts
  146. could not be opened\&.
  147. .sp
  148. The filesystem or device specified was not found\&.
  149. .sp
  150. The limits for the user could not be retrieved\&. See syslog for more information\&.
  151. .sp
  152. The limits for the user could not be set\&. See syslog for more information\&.
  153. .sp
  154. Either
  155. \fBisoftlimit\fR/\fBihardlimit\fR
  156. or
  157. \fBbsoftlimit\fR/\fBbhardlimit\fR
  158. were not set at the same time\&.
  159. .RE
  160. .SH "EXAMPLES"
  161. .PP
  162. A single invocation of `pam_setquota` applies a specific policy to a UID range\&. Applying different policies to specific UID ranges is done by invoking pam_setquota more than once\&. The last matching entry defines the resulting quota\&.
  163. .sp
  164. .if n \{\
  165. .RS 4
  166. .\}
  167. .nf
  168. session required pam_setquota\&.so bsoftlimit=1000 bhardlimit=2000 isoftlimit=1000 ihardlimit=2000 startuid=1000 enduid=0 fs=/home
  169. session required pam_setquota\&.so bsoftlimit=19000 bhardlimit=20000 isoftlimit=3000 ihardlimit=4000 startuid=2001 enduid=3000 fs=/dev/sda1
  170. session required pam_setquota\&.so bsoftlimit=19000 bhardlimit=20000 isoftlimit=3000 ihardlimit=4000 startuid=3001 enduid=4000 fs=/dev/sda1 overwrite=1
  171. .fi
  172. .if n \{\
  173. .RE
  174. .\}
  175. .sp
  176. .SH "SEE ALSO"
  177. .PP
  178. \fBpam.conf\fR(5),
  179. \fBpam.d\fR(5),
  180. \fBpam\fR(8)
  181. .SH "AUTHOR"
  182. .PP
  183. pam_setquota was originally written by Ruslan Savchenko <savrus@mexmat\&.net>\&.
  184. .PP
  185. Further modifications were made by Shane Tzen <shane@ict\&.usc\&.edu>, Sven Hartge <sven@svenhartge\&.de> and Keller Fuchs <kellerfuchs@hashbang\&.sh>\&.