1 .TH LDAP.CONF 5 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2013 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap.conf, .ldaprc \- LDAP configuration file/environment variables
8 ETCDIR/ldap.conf, ldaprc, .ldaprc, $LDAP<option-name>
10 If the environment variable \fBLDAPNOINIT\fP is defined, all
11 defaulting is disabled.
15 configuration file is used to set system-wide defaults to be applied when
20 Users may create an optional configuration file,
24 in their home directory which will be used to override the system-wide
28 in the current working directory is also used.
31 Additional configuration files can be specified using
32 the \fBLDAPCONF\fP and \fBLDAPRC\fP environment variables.
33 \fBLDAPCONF\fP may be set to the path of a configuration file. This
34 path can be absolute or relative to the current working directory.
35 The \fBLDAPRC\fP, if defined, should be the basename of a file
36 in the current working directory or in the user's home directory.
38 Environmental variables may also be used to augment the file based defaults.
39 The name of the variable is the option name with an added prefix of \fBLDAP\fP.
40 For example, to define \fBBASE\fP via the environment, set the variable
41 \fBLDAPBASE\fP to the desired value.
43 Some options are user-only. Such options are ignored if present
49 Thus the following files and variables are read, in order:
51 variable $LDAPNOINIT, and if that is not set:
52 system file ETCDIR/ldap.conf,
53 user files $HOME/ldaprc, $HOME/.ldaprc, ./ldaprc,
54 system file $LDAPCONF,
55 user files $HOME/$LDAPRC, $HOME/.$LDAPRC, ./$LDAPRC,
56 variables $LDAP<uppercase option name>.
58 Settings late in the list override earlier ones.
60 The configuration options are case-insensitive;
61 their value, on a case by case basis, may be case-sensitive.
63 Blank lines are ignored.
65 Lines beginning with a hash mark (`#') are comments, and ignored.
67 Valid lines are made of an option's name (a sequence of non-blanks,
68 conventionally written in uppercase, although not required),
70 The value starts with the first non-blank character after
71 the option's name, and terminates at the end of the line,
72 or at the last sequence of blanks before the end of the line.
73 The tokenization of the value, if any, is delegated to the handler(s)
74 for that option, if any. Quoting values that contain blanks
75 may be incorrect, as the quotes would become part of the value.
79 # Wrong - erroneous quotes:
80 URI "ldap:// ldaps://"
82 # Right - space-separated list of URIs, without quotes:
85 # Right - DN syntax needs quoting for Example, Inc:
86 BASE ou=IT staff,o="Example, Inc",c=US
88 BASE ou=IT staff,o=Example2C Inc,c=US
90 # Wrong - comment on same line as option:
91 DEREF never # Never follow aliases
94 A line cannot be longer than LINE_MAX, which should be more than 2000 bytes
96 There is no mechanism to split a long line on multiple lines, either for
97 beautification or to overcome the above limit.
99 The different configuration options are:
101 .B URI <ldap[si]://[name[:port]] ...>
102 Specifies the URI(s) of an LDAP server(s) to which the
104 library should connect. The URI scheme may be any of
109 which refer to LDAP over TCP, LDAP over SSL (TLS) and LDAP
110 over IPC (UNIX domain sockets), respectively.
111 Each server's name can be specified as a
112 domain-style name or an IP address literal. Optionally, the
113 server's name can followed by a ':' and the port number the LDAP
114 server is listening on. If no port number is provided, the default
115 port for the scheme is used (389 for ldap://, 636 for ldaps://).
118 is the name of the socket, and no
120 is required, nor allowed; note that directory separators must be
121 URL-encoded, like any other characters that are special to URLs;
128 ldapi://%2Fusr%2Flocal%2Fvar%2Fldapi
130 A space separated list of URIs may be provided.
133 Specifies the default base DN to use when performing ldap operations.
134 The base must be specified as a Distinguished Name in LDAP format.
137 Specifies the default bind DN to use when performing ldap operations.
138 The bind DN must be specified as a Distinguished Name in LDAP format.
139 .B This is a user-only option.
142 Specifies how alias dereferencing is done when performing a search. The
144 can be specified as one of the following keywords:
148 Aliases are never dereferenced. This is the default.
151 Aliases are dereferenced in subordinates of the base object, but
152 not in locating the base object of the search.
155 Aliases are only dereferenced when locating the base object of the search.
158 Aliases are dereferenced both in searching and in locating the base object
163 .B HOST <name[:port] ...>
164 Specifies the name(s) of an LDAP server(s) to which the
166 library should connect. Each server's name can be specified as a
167 domain-style name or an IP address and optionally followed by a ':' and
168 the port number the ldap server is listening on. A space separated
169 list of hosts may be provided.
171 is deprecated in favor of
174 .B NETWORK_TIMEOUT <integer>
175 Specifies the timeout (in seconds) after which the poll(2)/select(2)
176 following a connect(2) returns in case of no activity.
179 Specifies the default port used when connecting to LDAP servers(s).
180 The port may be specified as a number.
182 is deprecated in favor of
185 .B REFERRALS <on/true/yes/off/false/no>
186 Specifies if the client should automatically follow referrals returned
189 Note that the command line tools
191 &co always override this option.
192 .\" This should only be allowed via ldap_set_option(3)
194 .\".B RESTART <on/true/yes/off/false/no>
195 .\"Determines whether the library should implicitly restart connections (FIXME).
197 .B SIZELIMIT <integer>
198 Specifies a size limit (number of entries) to use when performing searches.
199 The number should be a non-negative integer. \fISIZELIMIT\fP of zero (0)
200 specifies a request for unlimited search size. Please note that the server
201 may still apply any server-side limit on the amount of entries that can be
202 returned by a search operation.
204 .B TIMELIMIT <integer>
205 Specifies a time limit (in seconds) to use when performing searches.
206 The number should be a non-negative integer. \fITIMELIMIT\fP of zero (0)
207 specifies unlimited search time to be used. Please note that the server
208 may still apply any server-side limit on the duration of a search operation.
210 Specifies what version of the LDAP protocol should be used.
213 Specifies a timeout (in seconds) after which calls to synchronous LDAP
214 APIs will abort if no response is received. Also used for any
216 calls where a NULL timeout parameter is supplied.
218 If OpenLDAP is built with Simple Authentication and Security Layer support,
219 there are more options you can specify.
221 .B SASL_MECH <mechanism>
222 Specifies the SASL mechanism to use.
223 .B This is a user-only option.
225 .B SASL_REALM <realm>
226 Specifies the SASL realm.
227 .B This is a user-only option.
229 .B SASL_AUTHCID <authcid>
230 Specifies the authentication identity.
231 .B This is a user-only option.
233 .B SASL_AUTHZID <authcid>
234 Specifies the proxy authorization identity.
235 .B This is a user-only option.
237 .B SASL_SECPROPS <properties>
238 Specifies Cyrus SASL security properties. The
240 can be specified as a comma-separated list of the following:
244 (without any other properties) causes the properties
245 defaults ("noanonymous,noplain") to be cleared.
248 disables mechanisms susceptible to simple passive attacks.
251 disables mechanisms susceptible to active attacks.
254 disables mechanisms susceptible to passive dictionary attacks.
257 disables mechanisms which support anonymous login.
260 requires forward secrecy between sessions.
263 requires mechanisms which pass client credentials (and allows
264 mechanisms which can pass credentials to do so).
267 specifies the minimum acceptable
268 .I security strength factor
269 as an integer approximating the effective key length used for
270 encryption. 0 (zero) implies no protection, 1 implies integrity
271 protection only, 56 allows DES or other weak ciphers, 112
272 allows triple DES and other strong ciphers, 128 allows RC4,
273 Blowfish and other modern strong ciphers. The default is 0.
276 specifies the maximum acceptable
277 .I security strength factor
280 description). The default is
283 .B maxbufsize=<factor>
284 specifies the maximum security layer receive buffer
285 size allowed. 0 disables security layers. The default is 65536.
288 If OpenLDAP is built with Generic Security Services Application Programming Interface support,
289 there are more options you can specify.
291 .B GSSAPI_SIGN <on/true/yes/off/false/no>
292 Specifies if GSSAPI signing (GSS_C_INTEG_FLAG) should be used.
295 .B GSSAPI_ENCRYPT <on/true/yes/off/false/no>
296 Specifies if GSSAPI encryption (GSS_C_INTEG_FLAG and GSS_C_CONF_FLAG)
297 should be used. The default is off.
299 .B GSSAPI_ALLOW_REMOTE_PRINCIPAL <on/true/yes/off/false/no>
300 Specifies if GSSAPI based authentication should try to form the
301 target principal name out of the ldapServiceName or dnsHostName
302 attribute of the targets RootDSE entry. The default is off.
304 If OpenLDAP is built with Transport Layer Security support, there
305 are more options you can specify. These options are used when an
307 is selected (by default or otherwise) or when the application
308 negotiates TLS by issuing the LDAP StartTLS operation.
310 .B TLS_CACERT <filename>
311 Specifies the file that contains certificates for all of the Certificate
312 Authorities the client will recognize.
314 .B TLS_CACERTDIR <path>
315 Specifies the path of a directory that contains Certificate Authority
316 certificates in separate individual files. The
318 is always used before
320 This parameter is ignored with GnuTLS.
322 When using Mozilla NSS, <path> may contain a Mozilla NSS cert/key
323 database. If <path> contains a Mozilla NSS cert/key database and
324 CA cert files, OpenLDAP will use the cert/key database and will
325 ignore the CA cert files.
327 .B TLS_CERT <filename>
328 Specifies the file that contains the client certificate.
329 .B This is a user-only option.
331 When using Mozilla NSS, if using a cert/key database (specified with
332 TLS_CACERTDIR), TLS_CERT specifies the name of the certificate to use:
334 TLS_CERT Certificate for Sam Carter
336 If using a token other than the internal built in token, specify the
337 token name first, followed by a colon:
339 TLS_CERT my hardware device:Certificate for Sam Carter
341 Use certutil -L to list the certificates by name:
343 certutil -d /path/to/certdbdir -L
346 .B TLS_KEY <filename>
347 Specifies the file that contains the private key that matches the certificate
350 file. Currently, the private key must not be protected with a password, so
351 it is of critical importance that the key file is protected carefully.
352 .B This is a user-only option.
354 When using Mozilla NSS, TLS_KEY specifies the name of a file that contains
355 the password for the key for the certificate specified with TLS_CERT. The
356 modutil command can be used to turn off password protection for the cert/key
357 database. For example, if TLS_CACERTDIR specifies /home/scarter/.moznss as
358 the location of the cert/key database, use modutil to change the password
361 modutil -dbdir ~/.moznss -changepw 'NSS Certificate DB'
363 You must have the old password, if any. Ignore the WARNING about the running
364 browser. Press 'Enter' for the new password.
367 .B TLS_CIPHER_SUITE <cipher-suite-spec>
368 Specifies acceptable cipher suite and preference order.
369 <cipher-suite-spec> should be a cipher specification for
370 the TLS library in use (OpenSSL, GnuTLS, or Mozilla NSS).
376 TLS_CIPHER_SUITE HIGH:MEDIUM:+SSLv2
379 TLS_CIPHER_SUITE SECURE256:!AES-128-CBC
382 To check what ciphers a given spec selects in OpenSSL, use:
385 openssl ciphers \-v <cipher-suite-spec>
388 With GnuTLS the available specs can be found in the manual page of
390 (see the description of the
394 In older versions of GnuTLS, where gnutls\-cli does not support the option
395 \-\-priority, you can obtain the \(em more limited \(em list of ciphers by calling:
401 When using Mozilla NSS, the OpenSSL cipher suite specifications are used and
402 translated into the format used internally by Mozilla NSS. There isn't an easy
403 way to list the cipher suites from the command line. The authoritative list
404 is in the source code for Mozilla NSS in the file sslinfo.c in the structure
406 static const SSLCipherSuiteInfo suiteInfo[]
410 .B TLS_RANDFILE <filename>
411 Specifies the file to obtain random bits from when /dev/[u]random is
412 not available. Generally set to the name of the EGD/PRNGD socket.
413 The environment variable RANDFILE can also be used to specify the filename.
414 This parameter is ignored with GnuTLS and Mozilla NSS.
416 .B TLS_REQCERT <level>
417 Specifies what checks to perform on server certificates in a TLS session,
420 can be specified as one of the following keywords:
424 The client will not request or check any server certificate.
427 The server certificate is requested. If no certificate is provided,
428 the session proceeds normally. If a bad certificate is provided, it will
429 be ignored and the session proceeds normally.
432 The server certificate is requested. If no certificate is provided,
433 the session proceeds normally. If a bad certificate is provided,
434 the session is immediately terminated.
437 These keywords are equivalent. The server certificate is requested. If no
438 certificate is provided, or a bad certificate is provided, the session
439 is immediately terminated. This is the default setting.
442 .B TLS_CRLCHECK <level>
443 Specifies if the Certificate Revocation List (CRL) of the CA should be
444 used to verify if the server certificates have not been revoked. This
447 parameter to be set. This parameter is ignored with GnuTLS and Mozilla NSS.
449 can be specified as one of the following keywords:
453 No CRL checks are performed
456 Check the CRL of the peer certificate
459 Check the CRL for a whole certificate chain
462 .B TLS_CRLFILE <filename>
463 Specifies the file containing a Certificate Revocation List to be used
464 to verify if the server certificates have not been revoked. This
465 parameter is only supported with GnuTLS and Mozilla NSS.
466 .SH "ENVIRONMENT VARIABLES"
469 disable all defaulting
472 path of a configuration file
475 basename of ldaprc file in $HOME or $CWD
478 Set <option-name> as from ldap.conf
482 system-wide ldap configuration file
484 .I $HOME/ldaprc, $HOME/.ldaprc
485 user ldap configuration file
488 local ldap configuration file
491 .BR ldap_set_option (3),
496 Kurt Zeilenga, The OpenLDAP Project