]> git.sur5r.net Git - openldap/blob - doc/man/man5/ldap.conf.5
b6735bab5cf96ec33d254177f3811ae5a8dc7511
[openldap] / doc / man / man5 / ldap.conf.5
1 .TH LDAP.CONF 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2017 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap.conf, .ldaprc \- LDAP configuration file/environment variables
7 .SH SYNOPSIS
8 ETCDIR/ldap.conf, ldaprc, .ldaprc, $LDAP<option-name>
9 .SH DESCRIPTION
10 If the environment variable \fBLDAPNOINIT\fP is defined, all
11 defaulting is disabled.
12 .LP
13 The
14 .I ldap.conf
15 configuration file is used to set system-wide defaults to be applied when
16 running
17 .I ldap
18 clients.
19 .LP
20 Users may create an optional configuration file,
21 .I ldaprc
22 or
23 .IR .ldaprc ,
24 in their home directory which will be used to override the system-wide
25 defaults file.
26 The file
27 .I ldaprc
28 in the current working directory is also used.
29 .LP
30 .LP
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.
37 .LP
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.
42 .LP
43 Some options are user-only.  Such options are ignored if present
44 in the
45 .I ldap.conf
46 (or file specified by
47 .BR LDAPCONF ).
48 .LP
49 Thus the following files and variables are read, in order:
50 .nf
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>.
57 .fi
58 Settings late in the list override earlier ones.
59 .SH SYNTAX
60 The configuration options are case-insensitive;
61 their value, on a case by case basis, may be case-sensitive.
62 .LP
63 Blank lines are ignored.
64 .br
65 Lines beginning with a hash mark (`#') are comments, and ignored.
66 .LP
67 Valid lines are made of an option's name (a sequence of non-blanks,
68 conventionally written in uppercase, although not required), 
69 followed by a value.
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.
76 For example,
77
78 .nf
79         # Wrong - erroneous quotes:
80         URI     "ldap:// ldaps://"
81
82         # Right - space-separated list of URIs, without quotes:
83         URI     ldap:// ldaps://
84
85         # Right - DN syntax needs quoting for Example, Inc:
86         BASE    ou=IT staff,o="Example, Inc",c=US
87         # or:
88         BASE    ou=IT staff,o=Example2C Inc,c=US
89
90         # Wrong - comment on same line as option:
91         DEREF   never           # Never follow aliases
92 .fi
93 .LP
94 A line cannot be longer than LINE_MAX, which should be more than 2000 bytes
95 on all platforms.
96 There is no mechanism to split a long line on multiple lines, either for
97 beautification or to overcome the above limit.
98 .SH OPTIONS
99 The different configuration options are:
100 .TP
101 .B URI <ldap[si]://[name[:port]] ...>
102 Specifies the URI(s) of an LDAP server(s) to which the
103 .I LDAP 
104 library should connect.  The URI scheme may be any of
105 .BR ldap ,
106 .B ldaps 
107 or
108 .BR ldapi ,
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://).
116 For LDAP over IPC,
117 .B name 
118 is the name of the socket, and no
119 .B port
120 is required, nor allowed; note that directory separators must be 
121 URL-encoded, like any other characters that are special to URLs; 
122 so the socket
123
124         /usr/local/var/ldapi
125
126 must be specified as
127
128         ldapi://%2Fusr%2Flocal%2Fvar%2Fldapi
129
130 A space separated list of URIs may be provided.
131 .TP
132 .B BASE <base>
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.
135 .TP
136 .B BINDDN <dn>
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.
140 .TP
141 .B DEREF <when>
142 Specifies how alias dereferencing is done when performing a search. The
143 .B <when>
144 can be specified as one of the following keywords:
145 .RS
146 .TP
147 .B never
148 Aliases are never dereferenced. This is the default.
149 .TP
150 .B searching
151 Aliases are dereferenced in subordinates of the base object, but
152 not in locating the base object of the search.
153 .TP
154 .B finding
155 Aliases are only dereferenced when locating the base object of the search.
156 .TP
157 .B always
158 Aliases are dereferenced both in searching and in locating the base object
159 of the search.
160 .RE
161 .TP
162 .TP
163 .B HOST <name[:port] ...>
164 Specifies the name(s) of an LDAP server(s) to which the
165 .I LDAP 
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.
170 .B HOST
171 is deprecated in favor of
172 .BR URI .
173 .TP
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.
177 .TP
178 .B PORT <port>
179 Specifies the default port used when connecting to LDAP servers(s).
180 The port may be specified as a number.
181 .B PORT
182 is deprecated in favor of
183 .BR URI.
184 .TP
185 .B REFERRALS <on/true/yes/off/false/no>
186 Specifies if the client should automatically follow referrals returned
187 by LDAP servers.
188 The default is on.
189 Note that the command line tools
190 .BR ldapsearch (1)
191 &co always override this option.
192 .\" This should only be allowed via ldap_set_option(3)
193 .\".TP
194 .\".B RESTART <on/true/yes/off/false/no>
195 .\"Determines whether the library should implicitly restart connections (FIXME).
196 .TP
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.
203 .TP
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.
209 .B VERSION {2|3}
210 Specifies what version of the LDAP protocol should be used.
211 .TP
212 .B TIMEOUT <integer>
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
215 .BR ldap_result (3)
216 calls where a NULL timeout parameter is supplied.
217 .SH SASL OPTIONS
218 If OpenLDAP is built with Simple Authentication and Security Layer support,
219 there are more options you can specify.
220 .TP
221 .B SASL_MECH <mechanism>
222 Specifies the SASL mechanism to use.
223 .B This is a user-only option.
224 .TP
225 .B SASL_REALM <realm>
226 Specifies the SASL realm.
227 .B This is a user-only option.
228 .TP
229 .B SASL_AUTHCID <authcid>
230 Specifies the authentication identity.
231 .B This is a user-only option.
232 .TP
233 .B SASL_AUTHZID <authcid>
234 Specifies the proxy authorization identity.
235 .B This is a user-only option.
236 .TP
237 .B SASL_SECPROPS <properties>
238 Specifies Cyrus SASL security properties. The 
239 .B <properties>
240 can be specified as a comma-separated list of the following:
241 .RS
242 .TP
243 .B none
244 (without any other properties) causes the properties
245 defaults ("noanonymous,noplain") to be cleared.
246 .TP
247 .B noplain
248 disables mechanisms susceptible to simple passive attacks.
249 .TP
250 .B noactive
251 disables mechanisms susceptible to active attacks.
252 .TP
253 .B nodict
254 disables mechanisms susceptible to passive dictionary attacks.
255 .TP
256 .B noanonymous
257 disables mechanisms which support anonymous login.
258 .TP
259 .B forwardsec
260 requires forward secrecy between sessions.
261 .TP
262 .B passcred
263 requires mechanisms which pass client credentials (and allows
264 mechanisms which can pass credentials to do so).
265 .TP
266 .B minssf=<factor> 
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.
274 .TP
275 .B maxssf=<factor> 
276 specifies the maximum acceptable
277 .I security strength factor
278 as an integer (see
279 .B minssf
280 description).  The default is
281 .BR INT_MAX .
282 .TP
283 .B maxbufsize=<factor> 
284 specifies the maximum security layer receive buffer
285 size allowed.  0 disables security layers.  The default is 65536.
286 .RE
287 .TP
288 .B SASL_NOCANON <on/true/yes/off/false/no>
289 Do not perform reverse DNS lookups to canonicalize SASL host names. The default is off.
290 .SH GSSAPI OPTIONS
291 If OpenLDAP is built with Generic Security Services Application Programming Interface support,
292 there are more options you can specify.
293 .TP
294 .B GSSAPI_SIGN <on/true/yes/off/false/no>
295 Specifies if GSSAPI signing (GSS_C_INTEG_FLAG) should be used.
296 The default is off.
297 .TP
298 .B GSSAPI_ENCRYPT <on/true/yes/off/false/no>
299 Specifies if GSSAPI encryption (GSS_C_INTEG_FLAG and GSS_C_CONF_FLAG)
300 should be used. The default is off.
301 .TP
302 .B GSSAPI_ALLOW_REMOTE_PRINCIPAL <on/true/yes/off/false/no>
303 Specifies if GSSAPI based authentication should try to form the
304 target principal name out of the ldapServiceName or dnsHostName
305 attribute of the targets RootDSE entry. The default is off.
306 .SH TLS OPTIONS
307 If OpenLDAP is built with Transport Layer Security support, there
308 are more options you can specify.  These options are used when an
309 .B ldaps:// URI
310 is selected (by default or otherwise) or when the application
311 negotiates TLS by issuing the LDAP StartTLS operation.
312 .TP
313 .B TLS_CACERT <filename>
314 Specifies the file that contains certificates for all of the Certificate
315 Authorities the client will recognize.
316 .TP
317 .B TLS_CACERTDIR <path>
318 Specifies the path of a directory that contains Certificate Authority
319 certificates in separate individual files. The
320 .B TLS_CACERT
321 is always used before
322 .B TLS_CACERTDIR.
323 This parameter is ignored with GnuTLS.
324
325 When using Mozilla NSS, <path> may contain a Mozilla NSS cert/key
326 database.  If <path> contains a Mozilla NSS cert/key database and
327 CA cert files, OpenLDAP will use the cert/key database and will
328 ignore the CA cert files.
329 .TP
330 .B TLS_CERT <filename>
331 Specifies the file that contains the client certificate.
332 .B This is a user-only option.
333
334 When using Mozilla NSS, if using a cert/key database (specified with
335 TLS_CACERTDIR), TLS_CERT specifies the name of the certificate to use:
336 .nf
337         TLS_CERT Certificate for Sam Carter
338 .fi
339 If using a token other than the internal built in token, specify the
340 token name first, followed by a colon:
341 .nf
342         TLS_CERT my hardware device:Certificate for Sam Carter
343 .fi
344 Use certutil \-L to list the certificates by name:
345 .nf
346         certutil \-d /path/to/certdbdir \-L
347 .fi
348 .TP
349 .B TLS_KEY <filename>
350 Specifies the file that contains the private key that matches the certificate
351 stored in the
352 .B TLS_CERT
353 file. Currently, the private key must not be protected with a password, so
354 it is of critical importance that the key file is protected carefully.
355 .B This is a user-only option.
356
357 When using Mozilla NSS, TLS_KEY specifies the name of a file that contains
358 the password for the key for the certificate specified with TLS_CERT.  The
359 modutil command can be used to turn off password protection for the cert/key
360 database.  For example, if TLS_CACERTDIR specifies /home/scarter/.moznss as
361 the location of the cert/key database, use modutil to change the password
362 to the empty string:
363 .nf
364         modutil \-dbdir ~/.moznss \-changepw 'NSS Certificate DB'
365 .fi
366 You must have the old password, if any.  Ignore the WARNING about the running
367 browser.  Press 'Enter' for the new password.
368
369 .TP
370 .B TLS_CIPHER_SUITE <cipher-suite-spec>
371 Specifies acceptable cipher suite and preference order.
372 <cipher-suite-spec> should be a cipher specification for 
373 the TLS library in use (OpenSSL, GnuTLS, or Mozilla NSS).
374 Example:
375 .RS
376 .RS
377 .TP
378 .I OpenSSL:
379 TLS_CIPHER_SUITE HIGH:MEDIUM:+SSLv2
380 .TP
381 .I GnuTLS:
382 TLS_CIPHER_SUITE SECURE256:!AES-128-CBC
383 .RE
384
385 To check what ciphers a given spec selects in OpenSSL, use:
386
387 .nf
388         openssl ciphers \-v <cipher-suite-spec>
389 .fi
390
391 With GnuTLS the available specs can be found in the manual page of 
392 .BR gnutls\-cli (1)
393 (see the description of the 
394 option
395 .BR \-\-priority ).
396
397 In older versions of GnuTLS, where gnutls\-cli does not support the option
398 \-\-priority, you can obtain the \(em more limited \(em list of ciphers by calling:
399
400 .nf
401         gnutls\-cli \-l
402 .fi
403
404 When using Mozilla NSS, the OpenSSL cipher suite specifications are used and
405 translated into the format used internally by Mozilla NSS.  There isn't an easy
406 way to list the cipher suites from the command line.  The authoritative list
407 is in the source code for Mozilla NSS in the file sslinfo.c in the structure
408 .nf
409         static const SSLCipherSuiteInfo suiteInfo[]
410 .fi
411 .RE
412 .TP
413 .B TLS_PROTOCOL_MIN <major>[.<minor>]
414 Specifies minimum SSL/TLS protocol version that will be negotiated.
415 If the server doesn't support at least that version,
416 the SSL handshake will fail.
417 To require TLS 1.x or higher, set this option to 3.(x+1),
418 e.g.,
419
420 .nf
421         TLS_PROTOCOL_MIN 3.2
422 .fi
423
424 would require TLS 1.1.
425 Specifying a minimum that is higher than that supported by the
426 OpenLDAP implementation will result in it requiring the
427 highest level that it does support.
428 This parameter is ignored with GnuTLS.
429 .TP
430 .B TLS_RANDFILE <filename>
431 Specifies the file to obtain random bits from when /dev/[u]random is
432 not available. Generally set to the name of the EGD/PRNGD socket.
433 The environment variable RANDFILE can also be used to specify the filename.
434 This parameter is ignored with GnuTLS and Mozilla NSS.
435 .TP
436 .B TLS_REQCERT <level>
437 Specifies what checks to perform on server certificates in a TLS session,
438 if any. The
439 .B <level>
440 can be specified as one of the following keywords:
441 .RS
442 .TP
443 .B never
444 The client will not request or check any server certificate.
445 .TP
446 .B allow
447 The server certificate is requested. If no certificate is provided,
448 the session proceeds normally. If a bad certificate is provided, it will
449 be ignored and the session proceeds normally.
450 .TP
451 .B try
452 The server certificate is requested. If no certificate is provided,
453 the session proceeds normally. If a bad certificate is provided,
454 the session is immediately terminated.
455 .TP
456 .B demand | hard
457 These keywords are equivalent. The server certificate is requested. If no
458 certificate is provided, or a bad certificate is provided, the session
459 is immediately terminated. This is the default setting.
460 .RE
461 .TP
462 .B TLS_CRLCHECK <level>
463 Specifies if the Certificate Revocation List (CRL) of the CA should be 
464 used to verify if the server certificates have not been revoked. This
465 requires
466 .B TLS_CACERTDIR
467 parameter to be set. This parameter is ignored with GnuTLS and Mozilla NSS.
468 .B <level>
469 can be specified as one of the following keywords:
470 .RS
471 .TP
472 .B none
473 No CRL checks are performed
474 .TP
475 .B peer
476 Check the CRL of the peer certificate
477 .TP
478 .B all
479 Check the CRL for a whole certificate chain
480 .RE
481 .TP
482 .B TLS_CRLFILE <filename>
483 Specifies the file containing a Certificate Revocation List to be used
484 to verify if the server certificates have not been revoked. This
485 parameter is only supported with GnuTLS and Mozilla NSS.
486 .SH "ENVIRONMENT VARIABLES"
487 .TP
488 LDAPNOINIT
489 disable all defaulting
490 .TP
491 LDAPCONF
492 path of a configuration file
493 .TP
494 LDAPRC
495 basename of ldaprc file in $HOME or $CWD
496 .TP
497 LDAP<option-name>
498 Set <option-name> as from ldap.conf
499 .SH FILES
500 .TP
501 .I  ETCDIR/ldap.conf
502 system-wide ldap configuration file
503 .TP
504 .I  $HOME/ldaprc, $HOME/.ldaprc
505 user ldap configuration file
506 .TP
507 .I  $CWD/ldaprc
508 local ldap configuration file
509 .SH "SEE ALSO"
510 .BR ldap (3),
511 .BR ldap_set_option (3),
512 .BR ldap_result (3),
513 .BR openssl (1),
514 .BR sasl (3)
515 .SH AUTHOR
516 Kurt Zeilenga, The OpenLDAP Project
517 .SH ACKNOWLEDGEMENTS
518 .so ../Project