1nslcd.conf(5) System Manager's Manual nslcd.conf(5)
2
3
4
6 nslcd.conf - configuration file for LDAP nameservice daemon
7
9 The nss-pam-ldapd package allows LDAP directory servers to be used as a
10 primary source of name service information. (Name service information
11 typically includes users, hosts, groups, and other such data histori‐
12 cally stored in flat files or NIS.)
13
14 The file nslcd.conf contains the configuration information for running
15 nslcd (see nslcd(8)). The file contains options, one on each line,
16 defining the way NSS lookups and PAM actions are mapped to LDAP
17 lookups.
18
20 RUNTIME OPTIONS
21 threads NUM
22 Specifies the number of threads to start that can handle
23 requests and perform LDAP queries. The default is to start 5
24 threads.
25
26 uid UID
27 This specifies the user id with which the daemon should be run.
28 This can be a numerical id or a symbolic value. If no uid is
29 specified no attempt to change the user will be made. Note that
30 you should use values that don't need LDAP to resolve.
31
32 gid GID
33 This specifies the group id with which the daemon should be run.
34 This can be a numerical id or a symbolic value. If no gid is
35 specified no attempt to change the group will be made. Note
36 that you should use values that don't need LDAP to resolve.
37
38 GENERAL CONNECTION OPTIONS
39 uri URI
40 Specifies the LDAP URI of the server to connect to. The URI
41 scheme may be ldap, ldapi or ldaps, specifying LDAP over TCP,
42 ICP or SSL respectively (if supported by the LDAP library).
43 Alternatively, the value DNS may be used to try to lookup the
44 server using DNS SRV records.
45
46 When using the ldapi scheme, %2f should be used to escape
47 slashes (e.g. ldapi://%2fvar%2frun%2fslapd%2fldapi/), although
48 most of the time this should not be needed.
49
50 This option may be specified multiple times. Normally, only the
51 first server will be used with the following servers as fall-
52 back (see bind_timelimit below).
53
54 If LDAP lookups are used for host name resolution, any host
55 names should be specified as an IP address or name that can be
56 resolved without using LDAP.
57
58 ldap_version VERSION
59 Specifies the version of the LDAP protocol to use. The default
60 is to use the maximum version supported by the LDAP library.
61
62 binddn DN
63 Specifies the distinguished name with which to bind to the
64 directory server for lookups. The default is to bind anony‐
65 mously.
66
67 bindpw PASSWORD
68 Specifies the clear text credentials with which to bind. This
69 option is only applicable when used with binddn above. If you
70 set this option you should consider changing the permissions of
71 the nslcd.conf file to only grant access to the root user.
72
73 rootpwmoddn DN
74 Specifies the distinguished name to use when the root user tries
75 to modify a user's password using the PAM module. The PAM module
76 prompts the user for the admin password instead of the user's
77 password.
78
79 SASL AUTHENTICATION OPTIONS
80 sasl_mech MECHANISM
81 Specifies the SASL mechanism to be used when performing SASL
82 authentication.
83
84 sasl_realm REALM
85 Specifies the SASL realm to be used when performing SASL authen‐
86 tication.
87
88 sasl_authcid AUTHCID
89 Specifies the authentication identity to be used when performing
90 SASL authentication.
91
92 sasl_authzid AUTHZID
93 Specifies the authorization identity to be used when performing
94 SASL authentication. Must be specified in one of the formats:
95 dn:<distinguished name> or u:<username>.
96
97 sasl_secprops PROPERTIES
98 Specifies Cyrus SASL security properties. Allowed values are
99 described in the ldap.conf(5) manual page.
100
101 KERBEROS AUTHENTICATION OPTIONS
102 krb5_ccname NAME
103 Set the name for the GSS-API Kerberos credentials cache.
104
105 SEARCH/MAPPING OPTIONS
106 base [MAP] DN
107 Specifies the base distinguished name (DN) to use as search
108 base. This option may be supplied multiple times and all speci‐
109 fied bases will be searched.
110
111 A global search base may be specified or a MAP-specific one. If
112 no MAP-specific search bases are defined the global ones are
113 used.
114
115 If, instead of a DN, the value DOMAIN is specified, the host's
116 DNS domain is used to construct a search base.
117
118 If this value is not defined an attempt is made to look it up in
119 the configured LDAP server. Note that if the LDAP server is
120 unavailable during start-up nslcd will not start.
121
122 scope [MAP] sub[tree]|one[level]|base
123 Specifies the search scope (subtree, one level or base object).
124 The default scope is subtree; base scope is almost never useful
125 for name service lookups.
126
127 deref never|searching|finding|always
128 Specifies the policy for dereferencing aliases. The default
129 policy is to never dereference aliases.
130
131 referrals yes|no
132 Specifies whether automatic referral chasing should be enabled.
133 The default behaviour is to chase referrals.
134
135 filter MAP FILTER
136 The FILTER is an LDAP search filter to use for a specific map.
137 The default filter is a basic search on the objectClass for the
138 map (e.g. (objectClass=posixAccount)).
139
140 map MAP ATTRIBUTE NEWATTRIBUTE
141 This option allows for custom attributes to be looked up instead
142 of the default RFC 2307 attributes. The MAP may be one of the
143 supported maps below. The ATTRIBUTE is the one as used in RFC
144 2307 (e.g. userPassword, ipProtocolNumber or macAddress). The
145 NEWATTRIBUTE may be any attribute as it is available in the
146 directory.
147
148 If the NEWATTRIBUTE is presented in quotes (") it is treated as
149 an expression which will be evaluated to build up the actual
150 value used. See the section on attribute mapping expressions
151 below for more details.
152
153 Only some attributes for passwd and shadow entries may be mapped
154 with an expression (because other attributes may be used in
155 search filters). For passwd entries the following attributes
156 may be mapped with an expression: gidNumber, gecos, homeDirec‐
157 tory and loginShell. For shadow entries the following
158 attributes may be mapped with an expression: shadowLastChange,
159 shadowMin, shadowMax, shadowWarning, shadowInactive, shadowEx‐
160 pire and shadowFlag.
161
162 TIMING/RECONNECT OPTIONS
163 bind_timelimit SECONDS
164 Specifies the time limit (in seconds) to use when connecting to
165 the directory server. This is distinct from the time limit
166 specified in timelimit and affects the set-up of the connection
167 only. Note that not all LDAP client libraries have support for
168 setting the connection time out. The default bind_timelimit is
169 10 seconds.
170
171 timelimit SECONDS
172 Specifies the time limit (in seconds) to wait for a response
173 from the LDAP server. A value of zero (0), which is the
174 default, is to wait indefinitely for searches to be completed.
175
176 idle_timelimit SECONDS
177 Specifies the period if inactivity (in seconds) after which the
178 connection to the LDAP server will be closed. The default is
179 not to time out connections.
180
181 reconnect_sleeptime SECONDS
182 Specifies the number of seconds to sleep when connecting to all
183 LDAP servers fails. By default 1 second is waited between the
184 first failure and the first retry.
185
186 reconnect_retrytime SECONDS
187 Specifies the time after which the LDAP server is considered to
188 be permanently unavailable. Once this time is reached retries
189 will be done only once per this time period. The default value
190 is 10 seconds.
191
192 Note that the reconnect logic as described above is the mechanism that
193 is used between nslcd and the LDAP server. The mechanism between the
194 NSS and PAM client libraries on one end and nslcd on the other is sim‐
195 pler with a fixed compiled-in time out of a 10 seconds for writing to
196 nslcd and a time out of 60 seconds for reading answers. nslcd itself
197 has a read time out of 0.5 seconds and a write time out of 60 seconds.
198
199 SSL/TLS OPTIONS
200 ssl on|off|start_tls
201 Specifies whether to use SSL/TLS or not (the default is not to).
202 If start_tls is specified then StartTLS is used rather than raw
203 LDAP over SSL. Not all LDAP client libraries support both SSL,
204 StartTLS and all related configuration options.
205
206 tls_reqcert never|allow|try|demand|hard
207 Specifies what checks to perform on a server-supplied certifi‐
208 cate. The meaning of the values is described in the
209 ldap.conf(5) manual page. At least one of tls_cacertdir and
210 tls_cacertfile is required if peer verification is enabled.
211
212 tls_cacertdir PATH
213 Specifies the directory containing X.509 certificates for peer
214 authentication.
215
216 tls_cacertfile PATH
217 Specifies the path to the X.509 certificate for peer authentica‐
218 tion.
219
220 tls_randfile PATH
221 Specifies the path to an entropy source.
222
223 tls_ciphers CIPHERS
224 Specifies the ciphers to use for TLS. See your TLS implementa‐
225 tion's documentation for further information.
226
227 tls_cert PATH
228 Specifies the path to the file containing the local certificate
229 for client TLS authentication.
230
231 tls_key PATH
232 Specifies the path to the file containing the private key for
233 client TLS authentication.
234
235 OTHER OPTIONS
236 pagesize NUMBER
237 Set this to a number greater than 0 to request paged results
238 from the LDAP server in accordance with RFC2696. The default
239 (0) is to not request paged results.
240
241 This is useful for LDAP servers that contain a lot of entries
242 (e.g. more than 500) and limit the number of entries that are
243 returned with one request. For OpenLDAP servers you may need to
244 set sizelimit size.prtotal=unlimited for allowing more entries
245 to be returned over multiple pages.
246
247 nss_initgroups_ignoreusers user1,user2,...
248 This option prevents group membership lookups through LDAP for
249 the specified users. This can be useful in case of unavailabil‐
250 ity of the LDAP server. This option may be specified multiple
251 times.
252
253 Alternatively, the value ALLLOCAL may be used. With that value
254 nslcd builds a full list of non-LDAP users on startup.
255
256 pam_authz_search FILTER
257 This option allows flexible fine tuning of the authorisation
258 check that should be performed. The search filter specified is
259 executed and if any entries match, access is granted, otherwise
260 access is denied.
261
262 The search filter can contain the following variable references:
263 $username, $service, $ruser, $rhost, $tty, $hostname, $dn, and
264 $uid. These references are substituted in the search filter
265 using the same syntax as described in the section on attribute
266 mapping expressions below.
267
268 For example, to check that the user has a proper authorizedSer‐
269 vice value if the attribute is present: (&(objectClass=posixAc‐
270 count)(uid=$username) (|(authorizedService=$service)(!(autho‐
271 rizedService=*))))
272
273 The default behaviour is not to do this extra search and always
274 grant access.
275
277 The following maps are supported. They are referenced as MAP in the
278 options above.
279
280 alias[es]
281 Mail aliases. Note that most mail servers do not use the NSS
282 interface for requesting mail aliases and parse /etc/aliases on
283 their own.
284
285 ether[s]
286 Ethernet numbers (mac addresses).
287
288 group Posix groups.
289
290 host[s]
291 Host names.
292
293 netgroup
294 Host and user groups used for access control.
295
296 network[s]
297 Network numbers.
298
299 passwd Posix users.
300
301 protocol[s]
302 Protocol definitions (like in /etc/protocols).
303
304 rpc Remote procedure call names and numbers.
305
306 service[s]
307 Network service names and numbers.
308
309 shadow Shadow user password information.
310
312 For some attributes a mapping expression may be used to construct the
313 resulting value. This is currently only possible for attributes that do
314 not need to be used in search filters.
315
316 The expressions are a subset of the double quoted string expressions in
317 the Bourne (POSIX) shell. Instead of variable substitution, attribute
318 lookups are done on the current entry and the attribute value is sub‐
319 stituted. The following expressions are supported:
320
321 ${attr} (or $attr for short)
322 will substitute the value of the attribute
323
324 ${attr:-word}
325 (use default) will substitbute the value of the attribute or, if
326 the attribute is not set or empty substitute the word
327
328 ${attr:+word}
329 (use alternative) will substitbute word if attribute is set,
330 otherwise substitute the empty string
331
332 The nslcd daemon checks the expressions to figure out which attributes
333 to fetch from LDAP. Some examples to demonstrate how these expressions
334 may be used in attribute mapping:
335
336 "${shadowFlag:-0}"
337 use the shadowFlag attribute, using the value 0 as default
338
339 "${homeDirectory:-/home/$uid}"
340 use the uid attribute to build a homeDirectory value if that
341 attribute is missing
342
343 "${isDisabled:+100}"
344 if the isDisabled attribute is set, return 100, otherwise leave
345 value empty
346
348 /etc/nslcd.conf
349 the main configuration file
350
351 /etc/nsswitch.conf
352 Name Service Switch configuration file
353
355 nslcd(8), nsswitch.conf(5)
356
358 This manual was written by Arthur de Jong <arthur@arthurdejong.org> and
359 is based on the nss_ldap(5) manual developed by PADL Software Pty Ltd.
360
361
362
363Version 0.7.13 Dec 2010 nslcd.conf(5)