]> git.sur5r.net Git - openldap/blob - doc/man/man5/ldap.conf.5
Happy New Year!
[openldap] / doc / man / man5 / ldap.conf.5
1 .TH LDAP.CONF 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2016 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 .SH GSSAPI OPTIONS
288 If OpenLDAP is built with Generic Security Services Application Programming Interface support,
289 there are more options you can specify.
290 .TP
291 .B GSSAPI_SIGN <on/true/yes/off/false/no>
292 Specifies if GSSAPI signing (GSS_C_INTEG_FLAG) should be used.
293 The default is off.
294 .TP
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.
298 .TP
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.
303 .SH TLS OPTIONS
304 If OpenLDAP is built with Transport Layer Security support, there
305 are more options you can specify.  These options are used when an
306 .B ldaps:// URI
307 is selected (by default or otherwise) or when the application
308 negotiates TLS by issuing the LDAP StartTLS operation.
309 .TP
310 .B TLS_CACERT <filename>
311 Specifies the file that contains certificates for all of the Certificate
312 Authorities the client will recognize.
313 .TP
314 .B TLS_CACERTDIR <path>
315 Specifies the path of a directory that contains Certificate Authority
316 certificates in separate individual files. The
317 .B TLS_CACERT
318 is always used before
319 .B TLS_CACERTDIR.
320 This parameter is ignored with GnuTLS.
321
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.
326 .TP
327 .B TLS_CERT <filename>
328 Specifies the file that contains the client certificate.
329 .B This is a user-only option.
330
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:
333 .nf
334         TLS_CERT Certificate for Sam Carter
335 .fi
336 If using a token other than the internal built in token, specify the
337 token name first, followed by a colon:
338 .nf
339         TLS_CERT my hardware device:Certificate for Sam Carter
340 .fi
341 Use certutil -L to list the certificates by name:
342 .nf
343         certutil -d /path/to/certdbdir -L
344 .fi
345 .TP
346 .B TLS_KEY <filename>
347 Specifies the file that contains the private key that matches the certificate
348 stored in the
349 .B TLS_CERT
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.
353
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
359 to the empty string:
360 .nf
361         modutil -dbdir ~/.moznss -changepw 'NSS Certificate DB'
362 .fi
363 You must have the old password, if any.  Ignore the WARNING about the running
364 browser.  Press 'Enter' for the new password.
365
366 .TP
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).
371 Example:
372 .RS
373 .RS
374 .TP
375 .I OpenSSL:
376 TLS_CIPHER_SUITE HIGH:MEDIUM:+SSLv2
377 .TP
378 .I GnuTLS:
379 TLS_CIPHER_SUITE SECURE256:!AES-128-CBC
380 .RE
381
382 To check what ciphers a given spec selects in OpenSSL, use:
383
384 .nf
385         openssl ciphers \-v <cipher-suite-spec>
386 .fi
387
388 With GnuTLS the available specs can be found in the manual page of 
389 .BR gnutls\-cli (1)
390 (see the description of the 
391 option
392 .BR \-\-priority ).
393
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:
396
397 .nf
398         gnutls\-cli \-l
399 .fi
400
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
405 .nf
406         static const SSLCipherSuiteInfo suiteInfo[]
407 .fi
408 .RE
409 .TP
410 .B TLS_PROTOCOL_MIN <major>[.<minor>]
411 Specifies minimum SSL/TLS protocol version that will be negotiated.
412 If the server doesn't support at least that version,
413 the SSL handshake will fail.
414 To require TLS 1.x or higher, set this option to 3.(x+1),
415 e.g.,
416
417 .nf
418         TLS_PROTOCOL_MIN 3.2
419 .fi
420
421 would require TLS 1.1.
422 Specifying a minimum that is higher than that supported by the
423 OpenLDAP implementation will result in it requiring the
424 highest level that it does support.
425 This parameter is ignored with GnuTLS.
426 .TP
427 .B TLS_RANDFILE <filename>
428 Specifies the file to obtain random bits from when /dev/[u]random is
429 not available. Generally set to the name of the EGD/PRNGD socket.
430 The environment variable RANDFILE can also be used to specify the filename.
431 This parameter is ignored with GnuTLS and Mozilla NSS.
432 .TP
433 .B TLS_REQCERT <level>
434 Specifies what checks to perform on server certificates in a TLS session,
435 if any. The
436 .B <level>
437 can be specified as one of the following keywords:
438 .RS
439 .TP
440 .B never
441 The client will not request or check any server certificate.
442 .TP
443 .B allow
444 The server certificate is requested. If no certificate is provided,
445 the session proceeds normally. If a bad certificate is provided, it will
446 be ignored and the session proceeds normally.
447 .TP
448 .B try
449 The server certificate is requested. If no certificate is provided,
450 the session proceeds normally. If a bad certificate is provided,
451 the session is immediately terminated.
452 .TP
453 .B demand | hard
454 These keywords are equivalent. The server certificate is requested. If no
455 certificate is provided, or a bad certificate is provided, the session
456 is immediately terminated. This is the default setting.
457 .RE
458 .TP
459 .B TLS_CRLCHECK <level>
460 Specifies if the Certificate Revocation List (CRL) of the CA should be 
461 used to verify if the server certificates have not been revoked. This
462 requires
463 .B TLS_CACERTDIR
464 parameter to be set. This parameter is ignored with GnuTLS and Mozilla NSS.
465 .B <level>
466 can be specified as one of the following keywords:
467 .RS
468 .TP
469 .B none
470 No CRL checks are performed
471 .TP
472 .B peer
473 Check the CRL of the peer certificate
474 .TP
475 .B all
476 Check the CRL for a whole certificate chain
477 .RE
478 .TP
479 .B TLS_CRLFILE <filename>
480 Specifies the file containing a Certificate Revocation List to be used
481 to verify if the server certificates have not been revoked. This
482 parameter is only supported with GnuTLS and Mozilla NSS.
483 .SH "ENVIRONMENT VARIABLES"
484 .TP
485 LDAPNOINIT
486 disable all defaulting
487 .TP
488 LDAPCONF
489 path of a configuration file
490 .TP
491 LDAPRC
492 basename of ldaprc file in $HOME or $CWD
493 .TP
494 LDAP<option-name>
495 Set <option-name> as from ldap.conf
496 .SH FILES
497 .TP
498 .I  ETCDIR/ldap.conf
499 system-wide ldap configuration file
500 .TP
501 .I  $HOME/ldaprc, $HOME/.ldaprc
502 user ldap configuration file
503 .TP
504 .I  $CWD/ldaprc
505 local ldap configuration file
506 .SH "SEE ALSO"
507 .BR ldap (3),
508 .BR ldap_set_option (3),
509 .BR ldap_result (3),
510 .BR openssl (1),
511 .BR sasl (3)
512 .SH AUTHOR
513 Kurt Zeilenga, The OpenLDAP Project
514 .SH ACKNOWLEDGEMENTS
515 .so ../Project