Debian Codegraph @

upstream/debian-unstable/man8/pam_succeed_if.8

raw
1 '\" t
2 .\" Title: pam_succeed_if
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
5 .\" Date: 06/29/2025
6 .\" Manual: Linux-PAM Manual
7 .\" Source: Linux-PAM
8 .\" Language: English
9 .\"
10 .TH "PAM_SUCCEED_IF" "8" "06/29/2025" "Linux\-PAM" "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_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 debug
46 .RS 4
47 Turns on debugging messages sent to syslog\&.
48 .RE
49 .PP
50 use_uid
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 quiet
56 .RS 4
57 Don\*(Aqt log failure or success to the system log\&.
58 .RE
59 .PP
60 quiet_fail
61 .RS 4
62 Don\*(Aqt log failure to the system log\&.
63 .RE
64 .PP
65 quiet_success
66 .RS 4
67 Don\*(Aqt log success to the system log\&.
68 .RE
69 .PP
70 audit
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 field < number
90 .RS 4
91 Field has a value numerically less than number\&.
92 .RE
93 .PP
94 field <= number
95 .RS 4
96 Field has a value numerically less than or equal to number\&.
97 .RE
98 .PP
99 field eq number
100 .RS 4
101 Field has a value numerically equal to number\&.
102 .RE
103 .PP
104 field >= number
105 .RS 4
106 Field has a value numerically greater than or equal to number\&.
107 .RE
108 .PP
109 field > number
110 .RS 4
111 Field has a value numerically greater than number\&.
112 .RE
113 .PP
114 field ne number
115 .RS 4
116 Field has a value numerically different from number\&.
117 .RE
118 .PP
119 field = string
120 .RS 4
121 Field exactly matches the given string\&.
122 .RE
123 .PP
124 field != string
125 .RS 4
126 Field does not match the given string\&.
127 .RE
128 .PP
129 field =~ glob
130 .RS 4
131 Field matches the given glob\&.
132 .RE
133 .PP
134 field !~ glob
135 .RS 4
136 Field does not match the given glob\&.
137 .RE
138 .PP
139 field in item:item:\&.\&.\&.
140 .RS 4
141 Field is contained in the list of items separated by colons\&.
142 .RE
143 .PP
144 field notin item:item:\&.\&.\&.
145 .RS 4
146 Field is not contained in the list of items separated by colons\&.
147 .RE
148 .PP
149 user ingroup group[:group:\&.\&.\&.\&.]
150 .RS 4
151 User is in given group(s)\&.
152 .RE
153 .PP
154 user notingroup group[:group:\&.\&.\&.\&.]
155 .RS 4
156 User is not in given group(s)\&.
157 .RE
158 .PP
159 user innetgr netgroup
160 .RS 4
161 (user,host) is in given netgroup\&.
162 .RE
163 .PP
164 user notinnetgr group
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
202 .fi
203 .if n \{\
204 .RE
205 .\}
206 .PP
207 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\&.
208 .sp
209 .if n \{\
210 .RS 4
211 .\}
212 .nf
213 type [default=1 success=ignore] pam_succeed_if\&.so quiet uid > 500
214 type required othermodule\&.so arguments\&.\&.\&.
215
216 .fi
217 .if n \{\
218 .RE
219 .\}
220 .SH "SEE ALSO"
221 .PP
222 \fBglob\fR(7),
223 \fBpam\fR(7)
224 .SH "AUTHOR"
225 .PP
226 Nalin Dahyabhai <nalin@redhat\&.com>