1LDAP.CONF(5) File Formats Manual LDAP.CONF(5)
2
3
4
6 ldap.conf, .ldaprc - LDAP configuration file/environment variables
7
9 /etc/openldap/ldap.conf, ldaprc, .ldaprc, $LDAP<option-name>
10
12 If the environment variable LDAPNOINIT is defined, all defaulting is
13 disabled.
14
15 The ldap.conf configuration file is used to set system-wide defaults to
16 be applied when running ldap clients.
17
18 Users may create an optional configuration file, ldaprc or .ldaprc, in
19 their home directory which will be used to override the system-wide
20 defaults file. The file ldaprc in the current working directory is NOT
21 used (this differs from upstream).
22
23 Additional configuration files can be specified using the LDAPCONF and
24 LDAPRC environment variables. LDAPCONF may be set to the path of a
25 configuration file. This path can be absolute or relative to the cur‐
26 rent working directory. The LDAPRC, if defined, should be the basename
27 of a file in the current working directory or in the user's home direc‐
28 tory.
29
30 Environmental variables may also be used to augment the file based
31 defaults. The name of the variable is the option name with an added
32 prefix of LDAP. For example, to define BASE via the environment, set
33 the variable LDAPBASE to the desired value.
34
35 Some options are user-only. Such options are ignored if present in the
36 ldap.conf (or file specified by LDAPCONF).
37
38 Thus the following files and variables are read, in order:
39 variable $LDAPNOINIT, and if that is not set:
40 system file /etc/openldap/ldap.conf,
41 user files $HOME/ldaprc, $HOME/.ldaprc, (NOT ./ldaprc, see above),
42 system file $LDAPCONF,
43 user files $HOME/$LDAPRC, $HOME/.$LDAPRC, ./$LDAPRC,
44 variables $LDAP<uppercase option name>.
45 Settings late in the list override earlier ones.
46
48 The configuration options are case-insensitive; their value, on a case
49 by case basis, may be case-sensitive.
50
51 Blank lines are ignored.
52 Lines beginning with a hash mark (`#') are comments, and ignored.
53
54 Valid lines are made of an option's name (a sequence of non-blanks,
55 conventionally written in uppercase, although not required), followed
56 by a value. The value starts with the first non-blank character after
57 the option's name, and terminates at the end of the line, or at the
58 last sequence of blanks before the end of the line. The tokenization
59 of the value, if any, is delegated to the handler(s) for that option,
60 if any. Quoting values that contain blanks may be incorrect, as the
61 quotes would become part of the value. For example,
62
63 # Wrong - erroneous quotes:
64 URI "ldap:// ldaps://"
65
66 # Right - space-separated list of URIs, without quotes:
67 URI ldap:// ldaps://
68
69 # Right - DN syntax needs quoting for Example, Inc:
70 BASE ou=IT staff,o="Example, Inc",c=US
71 # or:
72 BASE ou=IT staff,o=Example2C Inc,c=US
73
74 # Wrong - comment on same line as option:
75 DEREF never # Never follow aliases
76
77 A line cannot be longer than LINE_MAX, which should be more than 2000
78 bytes on all platforms. There is no mechanism to split a long line on
79 multiple lines, either for beautification or to overcome the above
80 limit.
81
83 The different configuration options are:
84
85 URI <ldap[si]://[name[:port]] ...>
86 Specifies the URI(s) of an LDAP server(s) to which the LDAP
87 library should connect. The URI scheme may be any of ldap,
88 ldaps or ldapi, which refer to LDAP over TCP, LDAP over SSL
89 (TLS) and LDAP over IPC (UNIX domain sockets), respectively.
90 Each server's name can be specified as a domain-style name or an
91 IP address literal. Optionally, the server's name can followed
92 by a ':' and the port number the LDAP server is listening on.
93 If no port number is provided, the default port for the scheme
94 is used (389 for ldap://, 636 for ldaps://). For LDAP over IPC,
95 name is the name of the socket, and no port is required, nor
96 allowed; note that directory separators must be URL-encoded,
97 like any other characters that are special to URLs; so the
98 socket
99
100 /usr/local/var/ldapi
101
102 must be specified as
103
104 ldapi://%2Fusr%2Flocal%2Fvar%2Fldapi
105
106 A space separated list of URIs may be provided.
107
108 BASE <base>
109 Specifies the default base DN to use when performing ldap opera‐
110 tions. The base must be specified as a Distinguished Name in
111 LDAP format.
112
113 BINDDN <dn>
114 Specifies the default bind DN to use when performing ldap opera‐
115 tions. The bind DN must be specified as a Distinguished Name in
116 LDAP format. This is a user-only option.
117
118 DEREF <when>
119 Specifies how alias dereferencing is done when performing a
120 search. The <when> can be specified as one of the following key‐
121 words:
122
123 never Aliases are never dereferenced. This is the default.
124
125 searching
126 Aliases are dereferenced in subordinates of the base
127 object, but not in locating the base object of the
128 search.
129
130 finding
131 Aliases are only dereferenced when locating the base
132 object of the search.
133
134 always Aliases are dereferenced both in searching and in locat‐
135 ing the base object of the search.
136
137
138 HOST <name[:port] ...>
139 Specifies the name(s) of an LDAP server(s) to which the
140 LDAP library should connect. Each server's name can be
141 specified as a domain-style name or an IP address and
142 optionally followed by a ':' and the port number the ldap
143 server is listening on. A space separated list of hosts
144 may be provided. HOST is deprecated in favor of URI.
145
146 NETWORK_TIMEOUT <integer>
147 Specifies the timeout (in seconds) after which the
148 poll(2)/select(2) following a connect(2) returns in case
149 of no activity.
150
151 PORT <port>
152 Specifies the default port used when connecting to LDAP
153 servers(s). The port may be specified as a number. PORT
154 is deprecated in favor of URI.
155
156 REFERRALS <on/true/yes/off/false/no>
157 Specifies if the client should automatically follow
158 referrals returned by LDAP servers. The default is on.
159 Note that the command line tools ldapsearch(1) &co always
160 override this option.
161
162 SIZELIMIT <integer>
163 Specifies a size limit (number of entries) to use when
164 performing searches. The number should be a non-negative
165 integer. SIZELIMIT of zero (0) specifies a request for
166 unlimited search size. Please note that the server may
167 still apply any server-side limit on the amount of
168 entries that can be returned by a search operation.
169
170 TIMELIMIT <integer>
171 Specifies a time limit (in seconds) to use when perform‐
172 ing searches. The number should be a non-negative inte‐
173 ger. TIMELIMIT of zero (0) specifies unlimited search
174 time to be used. Please note that the server may still
175 apply any server-side limit on the duration of a search
176 operation. VERSION {2|3} Specifies what version of the
177 LDAP protocol should be used.
178
179 TIMEOUT <integer>
180 Specifies a timeout (in seconds) after which calls to
181 synchronous LDAP APIs will abort if no response is
182 received. Also used for any ldap_result(3) calls where a
183 NULL timeout parameter is supplied.
184
186 If OpenLDAP is built with Simple Authentication and Security
187 Layer support, there are more options you can specify.
188
189 SASL_MECH <mechanism>
190 Specifies the SASL mechanism to use. This is a user-only
191 option.
192
193 SASL_REALM <realm>
194 Specifies the SASL realm. This is a user-only option.
195
196 SASL_AUTHCID <authcid>
197 Specifies the authentication identity. This is a user-
198 only option.
199
200 SASL_AUTHZID <authcid>
201 Specifies the proxy authorization identity. This is a
202 user-only option.
203
204 SASL_SECPROPS <properties>
205 Specifies Cyrus SASL security properties. The <proper‐
206 ties> can be specified as a comma-separated list of the
207 following:
208
209 none (without any other properties) causes the proper‐
210 ties defaults ("noanonymous,noplain") to be
211 cleared.
212
213 noplain
214 disables mechanisms susceptible to simple passive
215 attacks.
216
217 noactive
218 disables mechanisms susceptible to active attacks.
219
220 nodict disables mechanisms susceptible to passive dictio‐
221 nary attacks.
222
223 noanonymous
224 disables mechanisms which support anonymous login.
225
226 forwardsec
227 requires forward secrecy between sessions.
228
229 passcred
230 requires mechanisms which pass client credentials
231 (and allows mechanisms which can pass credentials
232 to do so).
233
234 minssf=<factor>
235 specifies the minimum acceptable security strength
236 factor as an integer approximating the effective
237 key length used for encryption. 0 (zero) implies
238 no protection, 1 implies integrity protection
239 only, 56 allows DES or other weak ciphers, 112
240 allows triple DES and other strong ciphers, 128
241 allows RC4, Blowfish and other modern strong
242 ciphers. The default is 0.
243
244 maxssf=<factor>
245 specifies the maximum acceptable security strength
246 factor as an integer (see minssf description).
247 The default is INT_MAX.
248
249 maxbufsize=<factor>
250 specifies the maximum security layer receive buf‐
251 fer size allowed. 0 disables security layers.
252 The default is 65536.
253
254 SASL_NOCANON <on/true/yes/off/false/no>
255 Do not perform reverse DNS lookups to canonicalize SASL
256 host names. The default is off.
257
259 If OpenLDAP is built with Generic Security Services Application
260 Programming Interface support, there are more options you can
261 specify.
262
263 GSSAPI_SIGN <on/true/yes/off/false/no>
264 Specifies if GSSAPI signing (GSS_C_INTEG_FLAG) should be
265 used. The default is off.
266
267 GSSAPI_ENCRYPT <on/true/yes/off/false/no>
268 Specifies if GSSAPI encryption (GSS_C_INTEG_FLAG and
269 GSS_C_CONF_FLAG) should be used. The default is off.
270
271 GSSAPI_ALLOW_REMOTE_PRINCIPAL <on/true/yes/off/false/no>
272 Specifies if GSSAPI based authentication should try to
273 form the target principal name out of the ldapServiceName
274 or dnsHostName attribute of the targets RootDSE entry.
275 The default is off.
276
278 If OpenLDAP is built with Transport Layer Security support,
279 there are more options you can specify. These options are used
280 when an ldaps:// URI is selected (by default or otherwise) or
281 when the application negotiates TLS by issuing the LDAP StartTLS
282 operation.
283
284 TLS_CACERT <filename>
285 Specifies the file that contains certificates for all of
286 the Certificate Authorities the client will recognize.
287
288 TLS_CACERTDIR <path>
289 Specifies the path of a directory that contains Certifi‐
290 cate Authority certificates in separate individual files.
291 The TLS_CACERT is always used before TLS_CACERTDIR. The
292 specified directory must be managed with the OpenSSL
293 c_rehash utility. This parameter is ignored with GnuTLS.
294
295 When using Mozilla NSS, <path> may contain a Mozilla NSS
296 cert/key database. If <path> contains a Mozilla NSS
297 cert/key database and CA cert files, OpenLDAP will use
298 the cert/key database and will ignore the CA cert files.
299
300 TLS_CERT <filename>
301 Specifies the file that contains the client certificate.
302 This is a user-only option.
303
304 When using Mozilla NSS, if using a cert/key database
305 (specified with TLS_CACERTDIR), TLS_CERT specifies the
306 name of the certificate to use:
307 TLS_CERT Certificate for Sam Carter
308 If using a token other than the internal built in token,
309 specify the token name first, followed by a colon:
310 TLS_CERT my hardware device:Certificate for Sam Carter
311 Use certutil -L to list the certificates by name:
312 certutil -d /path/to/certdbdir -L
313
314 TLS_KEY <filename>
315 Specifies the file that contains the private key that
316 matches the certificate stored in the TLS_CERT file. Cur‐
317 rently, the private key must not be protected with a
318 password, so it is of critical importance that the key
319 file is protected carefully. This is a user-only option.
320
321 When using Mozilla NSS, TLS_KEY specifies the name of a
322 file that contains the password for the key for the cer‐
323 tificate specified with TLS_CERT. The modutil command
324 can be used to turn off password protection for the
325 cert/key database. For example, if TLS_CACERTDIR speci‐
326 fies /home/scarter/.moznss as the location of the
327 cert/key database, use modutil to change the password to
328 the empty string:
329 modutil -dbdir ~/.moznss -changepw 'NSS Certificate DB'
330 You must have the old password, if any. Ignore the WARN‐
331 ING about the running browser. Press 'Enter' for the new
332 password.
333
334
335 TLS_CIPHER_SUITE <cipher-suite-spec>
336 Specifies acceptable cipher suite and preference order.
337 <cipher-suite-spec> should be a cipher specification for
338 the TLS library in use (OpenSSL, GnuTLS, or Mozilla NSS).
339 Example:
340
341 OpenSSL:
342 TLS_CIPHER_SUITE HIGH:MEDIUM:+SSLv2
343
344 GnuTLS:
345 TLS_CIPHER_SUITE SECURE256:!AES-128-CBC
346
347 To check what ciphers a given spec selects in OpenSSL,
348 use:
349
350 openssl ciphers -v <cipher-suite-spec>
351
352 With GnuTLS the available specs can be found in the man‐
353 ual page of gnutls-cli(1) (see the description of the
354 option --priority).
355
356 In older versions of GnuTLS, where gnutls-cli does not
357 support the option --priority, you can obtain the — more
358 limited — list of ciphers by calling:
359
360 gnutls-cli -l
361
362 When using Mozilla NSS, the OpenSSL cipher suite specifi‐
363 cations are used and translated into the format used
364 internally by Mozilla NSS. There isn't an easy way to
365 list the cipher suites from the command line. The
366 authoritative list is in the source code for Mozilla NSS
367 in the file sslinfo.c in the structure
368 static const SSLCipherSuiteInfo suiteInfo[]
369
370 TLS_PROTOCOL_MIN <major>[.<minor>]
371 Specifies minimum SSL/TLS protocol version that will be
372 negotiated. If the server doesn't support at least that
373 version, the SSL handshake will fail. To require TLS 1.x
374 or higher, set this option to 3.(x+1), e.g.,
375
376 TLS_PROTOCOL_MIN 3.2
377
378 would require TLS 1.1. Specifying a minimum that is
379 higher than that supported by the OpenLDAP implementation
380 will result in it requiring the highest level that it
381 does support. This parameter is ignored with GnuTLS.
382
383 TLS_RANDFILE <filename>
384 Specifies the file to obtain random bits from when
385 /dev/[u]random is not available. Generally set to the
386 name of the EGD/PRNGD socket. The environment variable
387 RANDFILE can also be used to specify the filename. This
388 parameter is ignored with GnuTLS and Mozilla NSS.
389
390 TLS_REQCERT <level>
391 Specifies what checks to perform on server certificates
392 in a TLS session. The <level> can be specified as one of
393 the following keywords:
394
395 never The client will not request or check any server
396 certificate.
397
398 allow The server certificate is requested. If a bad
399 certificate is provided, it will be ignored and
400 the session proceeds normally.
401
402 try The server certificate is requested. If a bad cer‐
403 tificate is provided, the session is immediately
404 terminated.
405
406 demand | hard
407 These keywords are equivalent and semantically
408 same as try. This is the default setting.
409
410 TLS_CRLCHECK <level>
411 Specifies if the Certificate Revocation List (CRL) of the
412 CA should be used to verify if the server certificates
413 have not been revoked. This requires TLS_CACERTDIR param‐
414 eter to be set. This parameter is ignored with GnuTLS and
415 Mozilla NSS. <level> can be specified as one of the fol‐
416 lowing keywords:
417
418 none No CRL checks are performed
419
420 peer Check the CRL of the peer certificate
421
422 all Check the CRL for a whole certificate chain
423
424 TLS_CRLFILE <filename>
425 Specifies the file containing a Certificate Revocation
426 List to be used to verify if the server certificates have
427 not been revoked. This parameter is only supported with
428 GnuTLS and Mozilla NSS.
429
430 TLS_MOZNSS_COMPATIBILITY <on/true/yes/off/false/no>
431 Specifies whether the MozNSS database compatibility layer
432 for TLS options should be enabled. This options is avail‐
433 able only if OpenLDAP is compiled with OpenSSL. This
434 option defaults to be on.
435
437 LDAPNOINIT
438 disable all defaulting
439
440 LDAPCONF
441 path of a configuration file
442
443 LDAPRC basename of ldaprc file in $HOME or $CWD
444
445 LDAP<option-name>
446 Set <option-name> as from ldap.conf
447
449 /etc/openldap/ldap.conf
450 system-wide ldap configuration file
451
452 $HOME/ldaprc, $HOME/.ldaprc
453 user ldap configuration file
454
455 $CWD/ldaprc
456 local ldap configuration file
457
459 ldap(3), ldap_set_option(3), ldap_result(3), openssl(1), sasl(3)
460
462 Kurt Zeilenga, The OpenLDAP Project
463
465 OpenLDAP Software is developed and maintained by The OpenLDAP
466 Project <http://www.openldap.org/>. OpenLDAP Software is
467 derived from University of Michigan LDAP 3.3 Release.
468
469
470
471OpenLDAP 2.4.44 2016/02/05 LDAP.CONF(5)