]> git.sur5r.net Git - openldap/blob - doc/man/man5/ldap.conf.5
e4b43af6b0548712bf96db9ac64dfd52b946806f
[openldap] / doc / man / man5 / ldap.conf.5
1 .TH LDAP.CONF 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2009 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<option-name>.
57 .fi
58 Settings late in the list override earlier ones.
59 .SH OPTIONS
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 and lines beginning with a hash mark (`#')
64 are ignored up to their end.
65 .LP
66 Valid lines are made of an option's name (a sequence of non-blanks,
67 conventionally written in uppercase, although not required), 
68 followed by a value.
69 The value starts with the first non-blank character after 
70 the option's name, and terminates at the end of the line, 
71 or at the last sequence of blanks before the end of the line.
72 The tokenization of the value, if any, is delegated to the handler(s)
73 for that option, if any.  Quoting values that contain blanks 
74 may be incorrect, as the quotes would become part of the value.
75 For example,
76
77         URI     "ldap:// ldaps://"
78
79 is incorrect, while
80
81         URI     ldap:// ldaps://
82
83 is correct (note the absence of the double quotes).
84 .LP
85 A line cannot be longer than LINE_MAX, which should be more than 2000 bytes
86 on all platforms.
87 There is no mechanism to split a long line on multiple lines, either for
88 beautification or to overcome the above limit.
89 .LP
90 The different configuration options are:
91 .TP
92 .B URI <ldap[si]://[name[:port]] ...>
93 Specifies the URI(s) of an LDAP server(s) to which the
94 .I LDAP 
95 library should connect.  The URI scheme may be any of
96 .BR ldap ,
97 .B ldaps 
98 or
99 .BR ldapi ,
100 which refer to LDAP over TCP, LDAP over SSL (TLS) and LDAP
101 over IPC (UNIX domain sockets), respectively.
102 Each server's name can be specified as a
103 domain-style name or an IP address literal.  Optionally, the
104 server's name can followed by a ':' and the port number the LDAP
105 server is listening on.  If no port number is provided, the default
106 port for the scheme is used (389 for ldap://, 636 for ldaps://).
107 For LDAP over IPC,
108 .B name 
109 is the name of the socket, and no
110 .B port
111 is required, nor allowed; note that directory separators must be 
112 URL-encoded, like any other characters that are special to URLs; 
113 so the socket
114
115         /usr/local/var/ldapi
116
117 must be specified as
118
119         ldapi://%2Fusr%2Flocal%2Fvar%2Fldapi
120
121 A space separated list of URIs may be provided.
122 .TP
123 .B BASE <base>
124 Specifies the default base DN to use when performing ldap operations.
125 The base must be specified as a Distinguished Name in LDAP format.
126 .TP
127 .B BINDDN <dn>
128 Specifies the default bind DN to use when performing ldap operations.
129 The bind DN must be specified as a Distinguished Name in LDAP format.
130 .B This is a user\-only option.
131 .TP
132 .B DEREF <when>
133 Specifies how alias dereferencing is done when performing a search. The
134 .B <when>
135 can be specified as one of the following keywords:
136 .RS
137 .TP
138 .B never
139 Aliases are never dereferenced. This is the default.
140 .TP
141 .B searching
142 Aliases are dereferenced in subordinates of the base object, but
143 not in locating the base object of the search.
144 .TP
145 .B finding
146 Aliases are only dereferenced when locating the base object of the search.
147 .TP
148 .B always
149 Aliases are dereferenced both in searching and in locating the base object
150 of the search.
151 .RE
152 .TP
153 .TP
154 .B HOST <name[:port] ...>
155 Specifies the name(s) of an LDAP server(s) to which the
156 .I LDAP 
157 library should connect.  Each server's name can be specified as a
158 domain-style name or an IP address and optionally followed by a ':' and
159 the port number the ldap server is listening on.  A space separated
160 list of hosts may be provided.
161 .B HOST
162 is deprecated in favor of
163 .BR URI .
164 .TP
165 .B NETWORK_TIMEOUT <integer>
166 Specifies the timeout (in seconds) after which the poll(2)/select(2)
167 following a connect(2) returns in case of no activity.
168 .TP
169 .B PORT <port>
170 Specifies the default port used when connecting to LDAP servers(s).
171 The port may be specified as a number.
172 .B PORT
173 is deprecated in favor of
174 .BR URI.
175 .TP
176 .B REFERRALS <on/true/yes/off/false/no>
177 Specifies if the client should automatically follow referrals returned
178 by LDAP servers.
179 The default is on.
180 Note that the command line tools
181 .BR ldapsearch (1)
182 &co always override this option.
183 .\" This should only be allowed via ldap_set_option(3)
184 .\".TP
185 .\".B RESTART <on/true/yes/off/false/no>
186 .\"Determines whether the library should implicitly restart connections (FIXME).
187 .TP
188 .B SIZELIMIT <integer>
189 Specifies a size limit (number of entries) to use when performing searches.
190 The number should be a non-negative integer.  \fISIZELIMIT\fP of zero (0)
191 specifies a request for unlimited search size.  Please note that the server
192 may still apply any server-side limit on the amount of entries that can be 
193 returned by a search operation.
194 .TP
195 .B TIMELIMIT <integer>
196 Specifies a time limit (in seconds) to use when performing searches.
197 The number should be a non-negative integer.  \fITIMELIMIT\fP of zero (0)
198 specifies unlimited search time to be used.  Please note that the server
199 may still apply any server-side limit on the duration of a search operation.
200 .B VERSION {2|3}
201 Specifies what version of the LDAP protocol should be used.
202 .TP
203 .B TIMEOUT <integer>
204 Specifies a timeout (in seconds) after which calls to synchronous LDAP
205 APIs will abort if no response is received.  Also used for any
206 .BR ldap_result (3)
207 calls where a NULL timeout parameter is supplied.
208 .SH SASL OPTIONS
209 If OpenLDAP is built with Simple Authentication and Security Layer support,
210 there are more options you can specify.
211 .TP
212 .B SASL_MECH <mechanism>
213 Specifies the SASL mechanism to use.
214 .B This is a user\-only option.
215 .TP
216 .B SASL_REALM <realm>
217 Specifies the SASL realm.
218 .B This is a user\-only option.
219 .TP
220 .B SASL_AUTHCID <authcid>
221 Specifies the authentication identity.
222 .B This is a user\-only option.
223 .TP
224 .B SASL_AUTHZID <authcid>
225 Specifies the proxy authorization identity.
226 .B This is a user\-only option.
227 .TP
228 .B SASL_SECPROPS <properties>
229 Specifies Cyrus SASL security properties. The 
230 .B <properties>
231 can be specified as a comma-separated list of the following:
232 .RS
233 .TP
234 .B none
235 (without any other properties) causes the properties
236 defaults ("noanonymous,noplain") to be cleared.
237 .TP
238 .B noplain
239 disables mechanisms susceptible to simple passive attacks.
240 .TP
241 .B noactive
242 disables mechanisms susceptible to active attacks.
243 .TP
244 .B nodict
245 disables mechanisms susceptible to passive dictionary attacks.
246 .TP
247 .B noanonymous
248 disables mechanisms which support anonymous login.
249 .TP
250 .B forwardsec
251 requires forward secrecy between sessions.
252 .TP
253 .B passcred
254 requires mechanisms which pass client credentials (and allows
255 mechanisms which can pass credentials to do so).
256 .TP
257 .B minssf=<factor> 
258 specifies the minimum acceptable
259 .I security strength factor
260 as an integer approximating the effective key length used for
261 encryption.  0 (zero) implies no protection, 1 implies integrity
262 protection only, 56 allows DES or other weak ciphers, 112
263 allows triple DES and other strong ciphers, 128 allows RC4,
264 Blowfish and other modern strong ciphers.  The default is 0.
265 .TP
266 .B maxssf=<factor> 
267 specifies the maximum acceptable
268 .I security strength factor
269 as an integer (see
270 .B minssf
271 description).  The default is
272 .BR INT_MAX .
273 .TP
274 .B maxbufsize=<factor> 
275 specifies the maximum security layer receive buffer
276 size allowed.  0 disables security layers.  The default is 65536.
277 .RE
278 .SH GSSAPI OPTIONS
279 If OpenLDAP is built with Generic Security Services Application Programming Interface support,
280 there are more options you can specify.
281 .TP
282 .B GSSAPI_SIGN <on/true/yes/off/false/no>
283 Specifies if GSSAPI signing (GSS_C_INTEG_FLAG) should be used.
284 The default is off.
285 .TP
286 .B GSSAPI_ENCRYPT <on/true/yes/off/false/no>
287 Specifies if GSSAPI encryption (GSS_C_INTEG_FLAG and GSS_C_CONF_FLAG)
288 should be used. The default is off.
289 .TP
290 .B GSSAPI_ALLOW_REMOTE_PRINCIPAL <on/true/yes/off/false/no>
291 Specifies if GSSAPI based authentification should try to form the
292 target principal name out of the ldapServiceName or dnsHostName
293 attribute of the targets RootDSE entry. The default is off.
294 .SH TLS OPTIONS
295 If OpenLDAP is built with Transport Layer Security support, there
296 are more options you can specify.  These options are used when an
297 .B ldaps:// URI
298 is selected (by default or otherwise) or when the application
299 negotiates TLS by issuing the LDAP StartTLS operation.
300 .TP
301 .B TLS_CACERT <filename>
302 Specifies the file that contains certificates for all of the Certificate
303 Authorities the client will recognize.
304 .TP
305 .B TLS_CACERTDIR <path>
306 Specifies the path of a directory that contains Certificate Authority
307 certificates in separate individual files. The
308 .B TLS_CACERT
309 is always used before
310 .B TLS_CACERTDIR.
311 This parameter is ignored with GNUtls.
312 .TP
313 .B TLS_CERT <filename>
314 Specifies the file that contains the client certificate.
315 .B This is a user\-only option.
316 .TP
317 .B TLS_KEY <filename>
318 Specifies the file that contains the private key that matches the certificate
319 stored in the
320 .B TLS_CERT
321 file. Currently, the private key must not be protected with a password, so
322 it is of critical importance that the key file is protected carefully.
323 .B This is a user\-only option.
324 .TP
325 .B TLS_CIPHER_SUITE <cipher-suite-spec>
326 Specifies acceptable cipher suite and preference order.
327 <cipher-suite-spec> should be a cipher specification for OpenSSL,
328 e.g., HIGH:MEDIUM:+SSLv2.
329
330 To check what ciphers a given spec selects, use:
331
332 .nf
333         openssl ciphers -v <cipher-suite-spec>
334 .fi
335
336 To obtain the list of ciphers in GNUtls use:
337
338 .nf
339         gnutls-cli -l
340 .fi
341 .TP
342 .B TLS_RANDFILE <filename>
343 Specifies the file to obtain random bits from when /dev/[u]random is
344 not available. Generally set to the name of the EGD/PRNGD socket.
345 The environment variable RANDFILE can also be used to specify the filename.
346 This parameter is ignored with GNUtls.
347 .TP
348 .B TLS_REQCERT <level>
349 Specifies what checks to perform on server certificates in a TLS session,
350 if any. The
351 .B <level>
352 can be specified as one of the following keywords:
353 .RS
354 .TP
355 .B never
356 The client will not request or check any server certificate.
357 .TP
358 .B allow
359 The server certificate is requested. If no certificate is provided,
360 the session proceeds normally. If a bad certificate is provided, it will
361 be ignored and the session proceeds normally.
362 .TP
363 .B try
364 The server certificate is requested. If no certificate is provided,
365 the session proceeds normally. If a bad certificate is provided,
366 the session is immediately terminated.
367 .TP
368 .B demand | hard
369 These keywords are equivalent. The server certificate is requested. If no
370 certificate is provided, or a bad certificate is provided, the session
371 is immediately terminated. This is the default setting.
372 .RE
373 .TP
374 .B TLS_CRLCHECK <level>
375 Specifies if the Certificate Revocation List (CRL) of the CA should be 
376 used to verify if the server certificates have not been revoked. This
377 requires
378 .B TLS_CACERTDIR
379 parameter to be set. This parameter is ignored with GNUtls.
380 .B <level>
381 can be specified as one of the following keywords:
382 .RS
383 .TP
384 .B none
385 No CRL checks are performed
386 .TP
387 .B peer
388 Check the CRL of the peer certificate
389 .TP
390 .B all
391 Check the CRL for a whole certificate chain
392 .RE
393 .TP
394 .B TLS_CRLFILE <filename>
395 Specifies the file containing a Certificate Revocation List to be used
396 to verify if the server certificates have not been revoked. This
397 parameter is only supported with GNUtls.
398 .SH "ENVIRONMENT VARIABLES"
399 .TP
400 LDAPNOINIT
401 disable all defaulting
402 .TP
403 LDAPCONF
404 path of a configuration file
405 .TP
406 LDAPRC
407 basename of ldaprc file in $HOME or $CWD
408 .TP
409 LDAP<option-name>
410 Set <option-name> as from ldap.conf
411 .SH FILES
412 .TP
413 .I  ETCDIR/ldap.conf
414 system-wide ldap configuration file
415 .TP
416 .I  $HOME/ldaprc, $HOME/.ldaprc
417 user ldap configuration file
418 .TP
419 .I  $CWD/ldaprc
420 local ldap configuration file
421 .SH "SEE ALSO"
422 .BR ldap (3),
423 .BR ldap_set_option (3),
424 .BR ldap_result (3),
425 .BR openssl (1),
426 .BR sasl (3)
427 .SH AUTHOR
428 Kurt Zeilenga, The OpenLDAP Project
429 .SH ACKNOWLEDGEMENTS
430 .so ../Project