]> git.sur5r.net Git - openldap/blob - doc/man/man5/ldap.conf.5
cd3f6c340dcd0de33347a8e8834380d63d9ab8d6
[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 to use when performing searches.  The
190 number should be a non-negative integer.  \fISIZELIMIT\fP of zero (0)
191 specifies unlimited search size.
192 .TP
193 .B TIMELIMIT <integer>
194 Specifies a time limit to use when performing searches.  The
195 number should be a non-negative integer.  \fITIMELIMIT\fP of zero (0)
196 specifies unlimited search time to be used.
197 .B VERSION {2|3}
198 Specifies what version of the LDAP protocol should be used.
199 .TP
200 .B TIMEOUT <integer>
201 Specifies a timeout (in seconds) after which calls to synchronous LDAP
202 APIs will abort if no response is received.  Also used for any
203 .BR ldap_result (3)
204 calls where a NULL timeout parameter is supplied.
205 .SH SASL OPTIONS
206 If OpenLDAP is built with Simple Authentication and Security Layer support,
207 there are more options you can specify.
208 .TP
209 .B SASL_MECH <mechanism>
210 Specifies the SASL mechanism to use.
211 .B This is a user\-only option.
212 .TP
213 .B SASL_REALM <realm>
214 Specifies the SASL realm.
215 .B This is a user\-only option.
216 .TP
217 .B SASL_AUTHCID <authcid>
218 Specifies the authentication identity.
219 .B This is a user\-only option.
220 .TP
221 .B SASL_AUTHZID <authcid>
222 Specifies the proxy authorization identity.
223 .B This is a user\-only option.
224 .TP
225 .B SASL_SECPROPS <properties>
226 Specifies Cyrus SASL security properties. The 
227 .B <properties>
228 can be specified as a comma-separated list of the following:
229 .RS
230 .TP
231 .B none
232 (without any other properties) causes the properties
233 defaults ("noanonymous,noplain") to be cleared.
234 .TP
235 .B noplain
236 disables mechanisms susceptible to simple passive attacks.
237 .TP
238 .B noactive
239 disables mechanisms susceptible to active attacks.
240 .TP
241 .B nodict
242 disables mechanisms susceptible to passive dictionary attacks.
243 .TP
244 .B noanonymous
245 disables mechanisms which support anonymous login.
246 .TP
247 .B forwardsec
248 requires forward secrecy between sessions.
249 .TP
250 .B passcred
251 requires mechanisms which pass client credentials (and allows
252 mechanisms which can pass credentials to do so).
253 .TP
254 .B minssf=<factor> 
255 specifies the minimum acceptable
256 .I security strength factor
257 as an integer approximating the effective key length used for
258 encryption.  0 (zero) implies no protection, 1 implies integrity
259 protection only, 56 allows DES or other weak ciphers, 112
260 allows triple DES and other strong ciphers, 128 allows RC4,
261 Blowfish and other modern strong ciphers.  The default is 0.
262 .TP
263 .B maxssf=<factor> 
264 specifies the maximum acceptable
265 .I security strength factor
266 as an integer (see
267 .B minssf
268 description).  The default is
269 .BR INT_MAX .
270 .TP
271 .B maxbufsize=<factor> 
272 specifies the maximum security layer receive buffer
273 size allowed.  0 disables security layers.  The default is 65536.
274 .RE
275 .SH GSSAPI OPTIONS
276 If OpenLDAP is built with Generic Security Services Application Programming Interface support,
277 there are more options you can specify.
278 .TP
279 .B GSSAPI_SIGN <on/true/yes/off/false/no>
280 Specifies if GSSAPI signing (GSS_C_INTEG_FLAG) should be used.
281 The default is off.
282 .TP
283 .B GSSAPI_ENCRYPT <on/true/yes/off/false/no>
284 Specifies if GSSAPI encryption (GSS_C_INTEG_FLAG and GSS_C_CONF_FLAG)
285 should be used. The default is off.
286 .TP
287 .B GSSAPI_ALLOW_REMOTE_PRINCIPAL <on/true/yes/off/false/no>
288 Specifies if GSSAPI based authentification should try to form the
289 target principal name out of the ldapServiceName or dnsHostName
290 attribute of the targets RootDSE entry. The default is off.
291 .SH TLS OPTIONS
292 If OpenLDAP is built with Transport Layer Security support, there
293 are more options you can specify.  These options are used when an
294 .B ldaps:// URI
295 is selected (by default or otherwise) or when the application
296 negotiates TLS by issuing the LDAP StartTLS operation.
297 .TP
298 .B TLS_CACERT <filename>
299 Specifies the file that contains certificates for all of the Certificate
300 Authorities the client will recognize.
301 .TP
302 .B TLS_CACERTDIR <path>
303 Specifies the path of a directory that contains Certificate Authority
304 certificates in separate individual files. The
305 .B TLS_CACERT
306 is always used before
307 .B TLS_CACERTDIR.
308 This parameter is ignored with GNUtls.
309 .TP
310 .B TLS_CERT <filename>
311 Specifies the file that contains the client certificate.
312 .B This is a user\-only option.
313 .TP
314 .B TLS_KEY <filename>
315 Specifies the file that contains the private key that matches the certificate
316 stored in the
317 .B TLS_CERT
318 file. Currently, the private key must not be protected with a password, so
319 it is of critical importance that the key file is protected carefully.
320 .B This is a user\-only option.
321 .TP
322 .B TLS_CIPHER_SUITE <cipher-suite-spec>
323 Specifies acceptable cipher suite and preference order.
324 <cipher-suite-spec> should be a cipher specification for OpenSSL,
325 e.g., HIGH:MEDIUM:+SSLv2.
326
327 To check what ciphers a given spec selects, use:
328
329 .nf
330         openssl ciphers -v <cipher-suite-spec>
331 .fi
332
333 To obtain the list of ciphers in GNUtls use:
334
335 .nf
336         gnutls-cli -l
337 .fi
338 .TP
339 .B TLS_RANDFILE <filename>
340 Specifies the file to obtain random bits from when /dev/[u]random is
341 not available. Generally set to the name of the EGD/PRNGD socket.
342 The environment variable RANDFILE can also be used to specify the filename.
343 This parameter is ignored with GNUtls.
344 .TP
345 .B TLS_REQCERT <level>
346 Specifies what checks to perform on server certificates in a TLS session,
347 if any. The
348 .B <level>
349 can be specified as one of the following keywords:
350 .RS
351 .TP
352 .B never
353 The client will not request or check any server certificate.
354 .TP
355 .B allow
356 The server certificate is requested. If no certificate is provided,
357 the session proceeds normally. If a bad certificate is provided, it will
358 be ignored and the session proceeds normally.
359 .TP
360 .B try
361 The server certificate is requested. If no certificate is provided,
362 the session proceeds normally. If a bad certificate is provided,
363 the session is immediately terminated.
364 .TP
365 .B demand | hard
366 These keywords are equivalent. The server certificate is requested. If no
367 certificate is provided, or a bad certificate is provided, the session
368 is immediately terminated. This is the default setting.
369 .RE
370 .TP
371 .B TLS_CRLCHECK <level>
372 Specifies if the Certificate Revocation List (CRL) of the CA should be 
373 used to verify if the server certificates have not been revoked. This
374 requires
375 .B TLS_CACERTDIR
376 parameter to be set. This parameter is ignored with GNUtls.
377 .B <level>
378 can be specified as one of the following keywords:
379 .RS
380 .TP
381 .B none
382 No CRL checks are performed
383 .TP
384 .B peer
385 Check the CRL of the peer certificate
386 .TP
387 .B all
388 Check the CRL for a whole certificate chain
389 .RE
390 .TP
391 .B TLS_CRLFILE <filename>
392 Specifies the file containing a Certificate Revocation List to be used
393 to verify if the server certificates have not been revoked. This
394 parameter is only supported with GNUtls.
395 .SH "ENVIRONMENT VARIABLES"
396 .TP
397 LDAPNOINIT
398 disable all defaulting
399 .TP
400 LDAPCONF
401 path of a configuration file
402 .TP
403 LDAPRC
404 basename of ldaprc file in $HOME or $CWD
405 .TP
406 LDAP<option-name>
407 Set <option-name> as from ldap.conf
408 .SH FILES
409 .TP
410 .I  ETCDIR/ldap.conf
411 system-wide ldap configuration file
412 .TP
413 .I  $HOME/ldaprc, $HOME/.ldaprc
414 user ldap configuration file
415 .TP
416 .I  $CWD/ldaprc
417 local ldap configuration file
418 .SH "SEE ALSO"
419 .BR ldap (3),
420 .BR ldap_set_option (3),
421 .BR ldap_result (3),
422 .BR openssl (1),
423 .BR sasl (3)
424 .SH AUTHOR
425 Kurt Zeilenga, The OpenLDAP Project
426 .SH ACKNOWLEDGEMENTS
427 .so ../Project