]> git.sur5r.net Git - openldap/blob - doc/man/man5/ldap.conf.5
ITS#8818 SASL_MECH/SASL_REALM are not user-only
[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 .TP
224 .B SASL_REALM <realm>
225 Specifies the SASL realm.
226 .TP
227 .B SASL_AUTHCID <authcid>
228 Specifies the authentication identity.
229 .B This is a user-only option.
230 .TP
231 .B SASL_AUTHZID <authcid>
232 Specifies the proxy authorization identity.
233 .B This is a user-only option.
234 .TP
235 .B SASL_SECPROPS <properties>
236 Specifies Cyrus SASL security properties. The 
237 .B <properties>
238 can be specified as a comma-separated list of the following:
239 .RS
240 .TP
241 .B none
242 (without any other properties) causes the properties
243 defaults ("noanonymous,noplain") to be cleared.
244 .TP
245 .B noplain
246 disables mechanisms susceptible to simple passive attacks.
247 .TP
248 .B noactive
249 disables mechanisms susceptible to active attacks.
250 .TP
251 .B nodict
252 disables mechanisms susceptible to passive dictionary attacks.
253 .TP
254 .B noanonymous
255 disables mechanisms which support anonymous login.
256 .TP
257 .B forwardsec
258 requires forward secrecy between sessions.
259 .TP
260 .B passcred
261 requires mechanisms which pass client credentials (and allows
262 mechanisms which can pass credentials to do so).
263 .TP
264 .B minssf=<factor> 
265 specifies the minimum acceptable
266 .I security strength factor
267 as an integer approximating the effective key length used for
268 encryption.  0 (zero) implies no protection, 1 implies integrity
269 protection only, 56 allows DES or other weak ciphers, 112
270 allows triple DES and other strong ciphers, 128 allows RC4,
271 Blowfish and other modern strong ciphers.  The default is 0.
272 .TP
273 .B maxssf=<factor> 
274 specifies the maximum acceptable
275 .I security strength factor
276 as an integer (see
277 .B minssf
278 description).  The default is
279 .BR INT_MAX .
280 .TP
281 .B maxbufsize=<factor> 
282 specifies the maximum security layer receive buffer
283 size allowed.  0 disables security layers.  The default is 65536.
284 .RE
285 .TP
286 .B SASL_NOCANON <on/true/yes/off/false/no>
287 Do not perform reverse DNS lookups to canonicalize SASL host names. The default is off.
288 .SH GSSAPI OPTIONS
289 If OpenLDAP is built with Generic Security Services Application Programming Interface support,
290 there are more options you can specify.
291 .TP
292 .B GSSAPI_SIGN <on/true/yes/off/false/no>
293 Specifies if GSSAPI signing (GSS_C_INTEG_FLAG) should be used.
294 The default is off.
295 .TP
296 .B GSSAPI_ENCRYPT <on/true/yes/off/false/no>
297 Specifies if GSSAPI encryption (GSS_C_INTEG_FLAG and GSS_C_CONF_FLAG)
298 should be used. The default is off.
299 .TP
300 .B GSSAPI_ALLOW_REMOTE_PRINCIPAL <on/true/yes/off/false/no>
301 Specifies if GSSAPI based authentication should try to form the
302 target principal name out of the ldapServiceName or dnsHostName
303 attribute of the targets RootDSE entry. The default is off.
304 .SH TLS OPTIONS
305 If OpenLDAP is built with Transport Layer Security support, there
306 are more options you can specify.  These options are used when an
307 .B ldaps:// URI
308 is selected (by default or otherwise) or when the application
309 negotiates TLS by issuing the LDAP StartTLS operation.
310 .TP
311 .B TLS_CACERT <filename>
312 Specifies the file that contains certificates for all of the Certificate
313 Authorities the client will recognize.
314 .TP
315 .B TLS_CACERTDIR <path>
316 Specifies the path of a directory that contains Certificate Authority
317 certificates in separate individual files. The
318 .B TLS_CACERT
319 is always used before
320 .B TLS_CACERTDIR.
321 This parameter is ignored with GnuTLS.
322
323 When using Mozilla NSS, <path> may contain a Mozilla NSS cert/key
324 database.  If <path> contains a Mozilla NSS cert/key database and
325 CA cert files, OpenLDAP will use the cert/key database and will
326 ignore the CA cert files.
327 .TP
328 .B TLS_CERT <filename>
329 Specifies the file that contains the client certificate.
330 .B This is a user-only option.
331
332 When using Mozilla NSS, if using a cert/key database (specified with
333 TLS_CACERTDIR), TLS_CERT specifies the name of the certificate to use:
334 .nf
335         TLS_CERT Certificate for Sam Carter
336 .fi
337 If using a token other than the internal built in token, specify the
338 token name first, followed by a colon:
339 .nf
340         TLS_CERT my hardware device:Certificate for Sam Carter
341 .fi
342 Use certutil \-L to list the certificates by name:
343 .nf
344         certutil \-d /path/to/certdbdir \-L
345 .fi
346 .TP
347 .B TLS_KEY <filename>
348 Specifies the file that contains the private key that matches the certificate
349 stored in the
350 .B TLS_CERT
351 file. Currently, the private key must not be protected with a password, so
352 it is of critical importance that the key file is protected carefully.
353 .B This is a user-only option.
354
355 When using Mozilla NSS, TLS_KEY specifies the name of a file that contains
356 the password for the key for the certificate specified with TLS_CERT.  The
357 modutil command can be used to turn off password protection for the cert/key
358 database.  For example, if TLS_CACERTDIR specifies /home/scarter/.moznss as
359 the location of the cert/key database, use modutil to change the password
360 to the empty string:
361 .nf
362         modutil \-dbdir ~/.moznss \-changepw 'NSS Certificate DB'
363 .fi
364 You must have the old password, if any.  Ignore the WARNING about the running
365 browser.  Press 'Enter' for the new password.
366
367 .TP
368 .B TLS_CIPHER_SUITE <cipher-suite-spec>
369 Specifies acceptable cipher suite and preference order.
370 <cipher-suite-spec> should be a cipher specification for 
371 the TLS library in use (OpenSSL, GnuTLS, or Mozilla NSS).
372 Example:
373 .RS
374 .RS
375 .TP
376 .I OpenSSL:
377 TLS_CIPHER_SUITE HIGH:MEDIUM:+SSLv2
378 .TP
379 .I GnuTLS:
380 TLS_CIPHER_SUITE SECURE256:!AES-128-CBC
381 .RE
382
383 To check what ciphers a given spec selects in OpenSSL, use:
384
385 .nf
386         openssl ciphers \-v <cipher-suite-spec>
387 .fi
388
389 With GnuTLS the available specs can be found in the manual page of 
390 .BR gnutls\-cli (1)
391 (see the description of the 
392 option
393 .BR \-\-priority ).
394
395 In older versions of GnuTLS, where gnutls\-cli does not support the option
396 \-\-priority, you can obtain the \(em more limited \(em list of ciphers by calling:
397
398 .nf
399         gnutls\-cli \-l
400 .fi
401
402 When using Mozilla NSS, the OpenSSL cipher suite specifications are used and
403 translated into the format used internally by Mozilla NSS.  There isn't an easy
404 way to list the cipher suites from the command line.  The authoritative list
405 is in the source code for Mozilla NSS in the file sslinfo.c in the structure
406 .nf
407         static const SSLCipherSuiteInfo suiteInfo[]
408 .fi
409 .RE
410 .TP
411 .B TLS_PROTOCOL_MIN <major>[.<minor>]
412 Specifies minimum SSL/TLS protocol version that will be negotiated.
413 If the server doesn't support at least that version,
414 the SSL handshake will fail.
415 To require TLS 1.x or higher, set this option to 3.(x+1),
416 e.g.,
417
418 .nf
419         TLS_PROTOCOL_MIN 3.2
420 .fi
421
422 would require TLS 1.1.
423 Specifying a minimum that is higher than that supported by the
424 OpenLDAP implementation will result in it requiring the
425 highest level that it does support.
426 This parameter is ignored with GnuTLS.
427 .TP
428 .B TLS_RANDFILE <filename>
429 Specifies the file to obtain random bits from when /dev/[u]random is
430 not available. Generally set to the name of the EGD/PRNGD socket.
431 The environment variable RANDFILE can also be used to specify the filename.
432 This parameter is ignored with GnuTLS and Mozilla NSS.
433 .TP
434 .B TLS_REQCERT <level>
435 Specifies what checks to perform on server certificates in a TLS session,
436 if any. The
437 .B <level>
438 can be specified as one of the following keywords:
439 .RS
440 .TP
441 .B never
442 The client will not request or check any server certificate.
443 .TP
444 .B allow
445 The server certificate is requested. If no certificate is provided,
446 the session proceeds normally. If a bad certificate is provided, it will
447 be ignored and the session proceeds normally.
448 .TP
449 .B try
450 The server certificate is requested. If no certificate is provided,
451 the session proceeds normally. If a bad certificate is provided,
452 the session is immediately terminated.
453 .TP
454 .B demand | hard
455 These keywords are equivalent. The server certificate is requested. If no
456 certificate is provided, or a bad certificate is provided, the session
457 is immediately terminated. This is the default setting.
458 .RE
459 .TP
460 .B TLS_CRLCHECK <level>
461 Specifies if the Certificate Revocation List (CRL) of the CA should be 
462 used to verify if the server certificates have not been revoked. This
463 requires
464 .B TLS_CACERTDIR
465 parameter to be set. This parameter is ignored with GnuTLS and Mozilla NSS.
466 .B <level>
467 can be specified as one of the following keywords:
468 .RS
469 .TP
470 .B none
471 No CRL checks are performed
472 .TP
473 .B peer
474 Check the CRL of the peer certificate
475 .TP
476 .B all
477 Check the CRL for a whole certificate chain
478 .RE
479 .TP
480 .B TLS_CRLFILE <filename>
481 Specifies the file containing a Certificate Revocation List to be used
482 to verify if the server certificates have not been revoked. This
483 parameter is only supported with GnuTLS and Mozilla NSS.
484 .SH "ENVIRONMENT VARIABLES"
485 .TP
486 LDAPNOINIT
487 disable all defaulting
488 .TP
489 LDAPCONF
490 path of a configuration file
491 .TP
492 LDAPRC
493 basename of ldaprc file in $HOME or $CWD
494 .TP
495 LDAP<option-name>
496 Set <option-name> as from ldap.conf
497 .SH FILES
498 .TP
499 .I  ETCDIR/ldap.conf
500 system-wide ldap configuration file
501 .TP
502 .I  $HOME/ldaprc, $HOME/.ldaprc
503 user ldap configuration file
504 .TP
505 .I  $CWD/ldaprc
506 local ldap configuration file
507 .SH "SEE ALSO"
508 .BR ldap (3),
509 .BR ldap_set_option (3),
510 .BR ldap_result (3),
511 .BR openssl (1),
512 .BR sasl (3)
513 .SH AUTHOR
514 Kurt Zeilenga, The OpenLDAP Project
515 .SH ACKNOWLEDGEMENTS
516 .so ../Project