1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH PAM_LIST 7 "April 22, 2020"
.SH NAME
pam_list \- PAM account management module for UNIX
.SH SYNOPSIS
.nf
pam_list.so.1
.fi
.SH DESCRIPTION
The \fBpam_list\fR module implements \fBpam_sm_acct_mgmt\fR(3PAM), which
provides functionality to the PAM account management stack. The module
provides functions to validate that the user's account is valid on this
host based on a list of users, groups, and/or netgroups in the given file. The users,
groups, and netgroups are separated by newline character. Groups are specified
with character '%' and netgroups are specified with character '@' as prefix
before name of the group/netgroup in the list. The maximum line length is 1023
characters.
.sp
.LP
The username is the value of \fBPAM_USER\fR. The host is the value of
\fBPAM_RHOST\fR or, if \fBPAM_RHOST\fR is not set, the value of the localhost
as returned by \fBgethostname\fR(3C) is used.
.sp
.LP
If neither of the \fBallow\fR, \fBdeny\fR, or \fBcompat\fR options are
specified, the module will look for +/- entries in the local \fB/etc/passwd\fR
file. If this style is used, \fBnsswitch.conf\fR(5) must not be configured
with \fBcompat\fR for the \fBpasswd\fR database. If no relevant +/- entry
exists for the user, \fBpam_list\fR is not participating in result.
.sp
.LP
If \fBcompat\fR option is specified then the module will look for +/- entries
in the local \fB/etc/passwd\fR file. Other entries in this file will be counted
as + entries. If no relevant entry exits for the user, \fBpam_list\fR will deny
the access.
.sp
.LP
The following options can be passed to the module:
.sp
.ne 2
.na
\fB\fBallow=\fR\fR
.ad
.RS 19n
The full pathname to a file of allowed users, groups, and/or netgroups.
Only one of \fBallow=\fR or \fBdeny=\fR can be specified.
.RE
.sp
.ne 2
.na
\fB\fBcompat\fR\fR
.ad
.RS 19n
Activate \fBcompat\fR mode.
.RE
.sp
.ne 2
.na
\fB\fBdeny=\fR\fR
.ad
.RS 19n
The full pathname to a file of denied users, groups, and/or netgroups.
Only one of \fBdeny=\fR or \fBallow=\fR can be specified.
.RE
.sp
.ne 2
.na
\fB\fBdebug\fR\fR
.ad
.RS 19n
Provide \fBsyslog\fR(3C) debugging information at the \fBLOG_AUTH\fR |
\fBLOG_DEBUG\fR level.
.RE
.sp
.ne 2
.na
\fB\fBgroup\fR\fR
.ad
.RS 19n
The module should perform group membership matches for the username.
.RE
.sp
.ne 2
.na
\fB\fBuser\fR\fR
.ad
.RS 19n
The module should only perform netgroup matches on the username. This is the
default option.
.RE
.sp
.ne 2
.na
\fB\fBnouser\fR\fR
.ad
.RS 19n
The username should not be used in the netgroup match.
.RE
.sp
.ne 2
.na
\fB\fBhost\fR\fR
.ad
.RS 19n
Only the host should be used in netgroup matches.
.RE
.sp
.ne 2
.na
\fB\fBnohost\fR\fR
.ad
.RS 19n
The hostname should not be used in netgroup matches.
.RE
.sp
.ne 2
.na
\fB\fBuser_host_exact\fR\fR
.ad
.RS 19n
The user and hostname must be in the same netgroup.
.RE
.SH ERRORS
The following error values are returned:
.sp
.ne 2
.na
\fB\fBPAM_SERVICE_ERR\fR\fR
.ad
.RS 20n
An invalid set of module options was given in the \fBpam.conf\fR(5) for this
module, or the \fBuser/netgroup\fR file could not be opened.
.RE
.sp
.ne 2
.na
\fB\fBPAM_BUF_ERR\fR\fR
.ad
.RS 20n
A memory buffer error occurred.
.RE
.sp
.ne 2
.na
\fB\fBPAM_IGNORE\fR\fR
.ad
.RS 20n
The module is ignored, as it is not participating in the result.
.RE
.sp
.ne 2
.na
\fB\fBPAM_PERM_DENIED\fR\fR
.ad
.RS 20n
The user is not on the allow list or is on the deny list.
.RE
.sp
.ne 2
.na
\fB\fBPAM_SUCCESS\fR\fR
.ad
.RS 20n
The account is valid for use at this time.
.RE
.sp
.ne 2
.na
\fB\fBPAM_USER_UNKNOWN\fR\fR
.ad
.RS 20n
No account is present for the user
.RE
.SH EXAMPLES
\fBExample 1 \fRUsing \fBpam_list\fR in default mode
.sp
.LP
\fB/etc/pam.conf\fR modification looks like:
.sp
.in +2
.nf
other account requisite pam_roles.so.1
other account required pam_unix_account.so.1
other account required pam_list.so.1
.fi
.in -2
.sp
.LP
In the case of \fBdefault\fR mode or \fBcompat\fR mode, the important lines in
\fB/etc/passwd\fR appear as follows:
.sp
.in +2
.nf
+loginname - user is approved
-loginname - user is disapproved
+@netgroup - netgroup members are approved
-@netgroup - netgroup members are disapproved
.fi
.in -2
.LP
\fBExample 2 \fRUsing \fBpam_list\fR with allow file
.sp
.LP
\fB/etc/pam.conf\fR modification looks like:
.sp
.in +2
.nf
other account requisite pam_roles.so.1
other account required pam_unix_account.so.1
other account required pam_list.so.1 allow=/etc/users.allow
.fi
.in -2
.sp
.LP
\fB/etc/users.allow\fR contains:
.sp
.in +2
.nf
root
localloginname
remoteloginname
@netgroup
.fi
.in -2
.LP
\fBExample 3 \fRUsing \fBpam_list\fR with allow file to allow
members of the 'admins' group access.
.sp
.LP
\fB/etc/pam.conf\fR modification looks like:
.sp
.in +2
.nf
other account requisite pam_roles.so.1
other account required pam_unix_account.so.1
other account required pam_list.so.1 group allow=/etc/users.allow
.fi
.in -2
.sp
.LP
\fB/etc/users.allow\fR contains:
.sp
.in +2
.nf
root
%admins
.fi
.in -2
.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Committed
_
MT-Level MT-Safe with exceptions
.TE
.sp
.LP
The interfaces in \fBlibpam\fR(3LIB) are MT-Safe only if each thread within the
multithreaded application uses its own PAM handle.
.SH SEE ALSO
.BR syslog (3C),
.BR libpam (3LIB),
.BR pam (3PAM),
.BR pam_authenticate (3PAM),
.BR pam_sm_acct_mgmt (3PAM),
.BR nsswitch.conf (5),
.BR pam.conf (5),
.BR attributes (7)
|