pam_succeed_if.8 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. '\" t
  2. .\" Title: pam_succeed_if
  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
  7. .\" Source: Linux-PAM
  8. .\" Language: English
  9. .\"
  10. .TH "PAM_SUCCEED_IF" "8" "09/03/2021" "Linux-PAM" "Linux\-PAM"
  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_succeed_if \- test account characteristics
  32. .SH "SYNOPSIS"
  33. .HP \w'\fBpam_succeed_if\&.so\fR\ 'u
  34. \fBpam_succeed_if\&.so\fR [\fIflag\fR...] [\fIcondition\fR...]
  35. .SH "DESCRIPTION"
  36. .PP
  37. pam_succeed_if\&.so is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated or values of other PAM items\&. One use is to select whether to load other modules based on this test\&.
  38. .PP
  39. The module should be given one or more conditions as module arguments, and authentication will succeed only if all of the conditions are met\&.
  40. .SH "OPTIONS"
  41. .PP
  42. The following
  43. \fIflag\fRs are supported:
  44. .PP
  45. \fBdebug\fR
  46. .RS 4
  47. Turns on debugging messages sent to syslog\&.
  48. .RE
  49. .PP
  50. \fBuse_uid\fR
  51. .RS 4
  52. Evaluate conditions using the account of the user whose UID the application is running under instead of the user being authenticated\&.
  53. .RE
  54. .PP
  55. \fBquiet\fR
  56. .RS 4
  57. Don\*(Aqt log failure or success to the system log\&.
  58. .RE
  59. .PP
  60. \fBquiet_fail\fR
  61. .RS 4
  62. Don\*(Aqt log failure to the system log\&.
  63. .RE
  64. .PP
  65. \fBquiet_success\fR
  66. .RS 4
  67. Don\*(Aqt log success to the system log\&.
  68. .RE
  69. .PP
  70. \fBaudit\fR
  71. .RS 4
  72. Log unknown users to the system log\&.
  73. .RE
  74. .PP
  75. \fICondition\fRs are three words: a field, a test, and a value to test for\&.
  76. .PP
  77. Available fields are
  78. \fIuser\fR,
  79. \fIuid\fR,
  80. \fIgid\fR,
  81. \fIshell\fR,
  82. \fIhome\fR,
  83. \fIruser\fR,
  84. \fIrhost\fR,
  85. \fItty\fR
  86. and
  87. \fIservice\fR:
  88. .PP
  89. \fBfield < number\fR
  90. .RS 4
  91. Field has a value numerically less than number\&.
  92. .RE
  93. .PP
  94. \fBfield <= number\fR
  95. .RS 4
  96. Field has a value numerically less than or equal to number\&.
  97. .RE
  98. .PP
  99. \fBfield eq number\fR
  100. .RS 4
  101. Field has a value numerically equal to number\&.
  102. .RE
  103. .PP
  104. \fBfield >= number\fR
  105. .RS 4
  106. Field has a value numerically greater than or equal to number\&.
  107. .RE
  108. .PP
  109. \fBfield > number\fR
  110. .RS 4
  111. Field has a value numerically greater than number\&.
  112. .RE
  113. .PP
  114. \fBfield ne number\fR
  115. .RS 4
  116. Field has a value numerically different from number\&.
  117. .RE
  118. .PP
  119. \fBfield = string\fR
  120. .RS 4
  121. Field exactly matches the given string\&.
  122. .RE
  123. .PP
  124. \fBfield != string\fR
  125. .RS 4
  126. Field does not match the given string\&.
  127. .RE
  128. .PP
  129. \fBfield =~ glob\fR
  130. .RS 4
  131. Field matches the given glob\&.
  132. .RE
  133. .PP
  134. \fBfield !~ glob\fR
  135. .RS 4
  136. Field does not match the given glob\&.
  137. .RE
  138. .PP
  139. \fBfield in item:item:\&.\&.\&.\fR
  140. .RS 4
  141. Field is contained in the list of items separated by colons\&.
  142. .RE
  143. .PP
  144. \fBfield notin item:item:\&.\&.\&.\fR
  145. .RS 4
  146. Field is not contained in the list of items separated by colons\&.
  147. .RE
  148. .PP
  149. \fBuser ingroup group[:group:\&.\&.\&.\&.]\fR
  150. .RS 4
  151. User is in given group(s)\&.
  152. .RE
  153. .PP
  154. \fBuser notingroup group[:group:\&.\&.\&.\&.]\fR
  155. .RS 4
  156. User is not in given group(s)\&.
  157. .RE
  158. .PP
  159. \fBuser innetgr netgroup\fR
  160. .RS 4
  161. (user,host) is in given netgroup\&.
  162. .RE
  163. .PP
  164. \fBuser notinnetgr group\fR
  165. .RS 4
  166. (user,host) is not in given netgroup\&.
  167. .RE
  168. .SH "MODULE TYPES PROVIDED"
  169. .PP
  170. All module types (\fBaccount\fR,
  171. \fBauth\fR,
  172. \fBpassword\fR
  173. and
  174. \fBsession\fR) are provided\&.
  175. .SH "RETURN VALUES"
  176. .PP
  177. PAM_SUCCESS
  178. .RS 4
  179. The condition was true\&.
  180. .RE
  181. .PP
  182. PAM_AUTH_ERR
  183. .RS 4
  184. The condition was false\&.
  185. .RE
  186. .PP
  187. PAM_SERVICE_ERR
  188. .RS 4
  189. A service error occurred or the arguments can\*(Aqt be parsed correctly\&.
  190. .RE
  191. .SH "EXAMPLES"
  192. .PP
  193. To emulate the behaviour of
  194. \fIpam_wheel\fR, except there is no fallback to group 0 being only approximated by checking also the root group membership:
  195. .sp
  196. .if n \{\
  197. .RS 4
  198. .\}
  199. .nf
  200. auth required pam_succeed_if\&.so quiet user ingroup wheel:root
  201. .fi
  202. .if n \{\
  203. .RE
  204. .\}
  205. .PP
  206. Given that the type matches, only loads the othermodule rule if the UID is over 500\&. Adjust the number after default to skip several rules\&.
  207. .sp
  208. .if n \{\
  209. .RS 4
  210. .\}
  211. .nf
  212. type [default=1 success=ignore] pam_succeed_if\&.so quiet uid > 500
  213. type required othermodule\&.so arguments\&.\&.\&.
  214. .fi
  215. .if n \{\
  216. .RE
  217. .\}
  218. .SH "SEE ALSO"
  219. .PP
  220. \fBglob\fR(7),
  221. \fBpam\fR(8)
  222. .SH "AUTHOR"
  223. .PP
  224. Nalin Dahyabhai <nalin@redhat\&.com>