1LDAP.CONF(5)                  File Formats Manual                 LDAP.CONF(5)
2
3
4

NAME

6       ldap.conf, .ldaprc - LDAP configuration file/environment variables
7

SYNOPSIS

9       /etc/openldap/ldap.conf, ldaprc, .ldaprc, $LDAP<option-name>
10

DESCRIPTION

12       If  the  environment  variable LDAPNOINIT is defined, all defaulting is
13       disabled.
14
15       The ldap.conf configuration file is used to set system-wide defaults to
16       be applied when running ldap clients.
17
18       Users  may create an optional configuration file, ldaprc or .ldaprc, in
19       their home directory which will be used  to  override  the  system-wide
20       defaults  file.   The  file  ldaprc in the current working directory is
21       also used.
22
23       Additional configuration files can be specified using the LDAPCONF  and
24       LDAPRC  environment  variables.   LDAPCONF  may be set to the path of a
25       configuration file.  This path can be absolute or relative to the  cur‐
26       rent working directory.  The LDAPRC, if defined, should be the basename
27       of a file in the current working directory or in the user's home direc‐
28       tory.
29
30       Environmental  variables  may  also  be  used to augment the file based
31       defaults.  The name of the variable is the option name  with  an  added
32       prefix  of  LDAP.  For example, to define BASE via the environment, set
33       the variable LDAPBASE to the desired value.
34
35       Some options are user-only.  Such options are ignored if present in the
36       ldap.conf (or file specified by LDAPCONF).
37
38       Thus the following files and variables are read, in order:
39           variable     $LDAPNOINIT, and if that is not set:
40           system file  /etc/openldap/ldap.conf,
41           user files   $HOME/ldaprc,  $HOME/.ldaprc,  ./ldaprc,
42           system file  $LDAPCONF,
43           user files   $HOME/$LDAPRC, $HOME/.$LDAPRC, ./$LDAPRC,
44           variables    $LDAP<uppercase option name>.
45       Settings late in the list override earlier ones.
46

SYNTAX

48       The  configuration options are case-insensitive; their value, on a case
49       by case basis, may be case-sensitive.
50
51       Blank lines are ignored.
52       Lines beginning with a hash mark (`#') are comments, and ignored.
53
54       Valid lines are made of an option's name  (a  sequence  of  non-blanks,
55       conventionally  written  in uppercase, although not required), followed
56       by a value.  The value starts with the first non-blank character  after
57       the  option's  name,  and  terminates at the end of the line, or at the
58       last sequence of blanks before the end of the line.   The  tokenization
59       of  the  value, if any, is delegated to the handler(s) for that option,
60       if any.  Quoting values that contain blanks may be  incorrect,  as  the
61       quotes would become part of the value.  For example,
62
63            # Wrong - erroneous quotes:
64            URI     "ldap:// ldaps://"
65
66            # Right - space-separated list of URIs, without quotes:
67            URI     ldap:// ldaps://
68
69            # Right - DN syntax needs quoting for Example, Inc:
70            BASE    ou=IT staff,o="Example, Inc",c=US
71            # or:
72            BASE    ou=IT staff,o=Example2C Inc,c=US
73
74            # Wrong - comment on same line as option:
75            DEREF   never           # Never follow aliases
76
77       A  line  cannot be longer than LINE_MAX, which should be more than 2000
78       bytes on all platforms.  There is no mechanism to split a long line  on
79       multiple  lines,  either  for  beautification  or to overcome the above
80       limit.
81

OPTIONS

83       The different configuration options are:
84
85       URI <ldap[si]://[name[:port]] ...>
86              Specifies the URI(s) of an LDAP  server(s)  to  which  the  LDAP
87              library  should  connect.   The  URI  scheme may be any of ldap,
88              ldaps or ldapi, which refer to LDAP  over  TCP,  LDAP  over  SSL
89              (TLS)  and  LDAP  over  IPC (UNIX domain sockets), respectively.
90              Each server's name can be specified as a domain-style name or an
91              IP  address literal.  Optionally, the server's name can followed
92              by a ':' and the port number the LDAP server  is  listening  on.
93              If  no  port number is provided, the default port for the scheme
94              is used (389 for ldap://, 636 for ldaps://).  For LDAP over IPC,
95              name  is  the  name  of the socket, and no port is required, nor
96              allowed; note that directory  separators  must  be  URL-encoded,
97              like  any  other  characters  that  are  special to URLs; so the
98              socket
99
100                   /usr/local/var/ldapi
101
102              must be specified as
103
104                   ldapi://%2Fusr%2Flocal%2Fvar%2Fldapi
105
106              A space separated list of URIs may be provided.
107
108       BASE <base>
109              Specifies the default base DN to use when performing ldap opera‐
110              tions.   The  base  must be specified as a Distinguished Name in
111              LDAP format.
112
113       BINDDN <dn>
114              Specifies the default bind DN to use when performing ldap opera‐
115              tions.  The bind DN must be specified as a Distinguished Name in
116              LDAP format.  This is a user-only option.
117
118       DEREF <when>
119              Specifies how alias dereferencing  is  done  when  performing  a
120              search. The <when> can be specified as one of the following key‐
121              words:
122
123              never  Aliases are never dereferenced. This is the default.
124
125              searching
126                     Aliases are dereferenced  in  subordinates  of  the  base
127                     object,  but  not  in  locating  the  base  object of the
128                     search.
129
130              finding
131                     Aliases are only  dereferenced  when  locating  the  base
132                     object of the search.
133
134              always Aliases  are dereferenced both in searching and in locat‐
135                     ing the base object of the search.
136
137
138       HOST <name[:port] ...>
139              Specifies the name(s) of an LDAP server(s) to  which  the
140              LDAP  library  should connect.  Each server's name can be
141              specified as a domain-style name or  an  IP  address  and
142              optionally followed by a ':' and the port number the ldap
143              server is listening on.  A space separated list of  hosts
144              may be provided.  HOST is deprecated in favor of URI.
145
146       NETWORK_TIMEOUT <integer>
147              Specifies  the  timeout  (in  seconds)  after  which  the
148              poll(2)/select(2) following a connect(2) returns in  case
149              of no activity.
150
151       PORT <port>
152              Specifies  the  default port used when connecting to LDAP
153              servers(s).  The port may be specified as a number.  PORT
154              is deprecated in favor of URI.
155
156       REFERRALS <on/true/yes/off/false/no>
157              Specifies  if  the  client  should  automatically  follow
158              referrals returned by LDAP servers.  The default  is  on.
159              Note that the command line tools ldapsearch(1) &co always
160              override this option.
161
162       SIZELIMIT <integer>
163              Specifies a size limit (number of entries)  to  use  when
164              performing searches.  The number should be a non-negative
165              integer.  SIZELIMIT of zero (0) specifies a  request  for
166              unlimited  search  size.  Please note that the server may
167              still apply  any  server-side  limit  on  the  amount  of
168              entries that can be returned by a search operation.
169
170       TIMELIMIT <integer>
171              Specifies  a time limit (in seconds) to use when perform‐
172              ing searches.  The number should be a non-negative  inte‐
173              ger.   TIMELIMIT  of  zero (0) specifies unlimited search
174              time to be used.  Please note that the server  may  still
175              apply  any  server-side limit on the duration of a search
176              operation.  VERSION {2|3} Specifies what version  of  the
177              LDAP protocol should be used.
178
179       TIMEOUT <integer>
180              Specifies  a  timeout  (in  seconds) after which calls to
181              synchronous LDAP  APIs  will  abort  if  no  response  is
182              received.  Also used for any ldap_result(3) calls where a
183              NULL timeout parameter is supplied.
184

SASL OPTIONS

186       If OpenLDAP is built with  Simple  Authentication  and  Security
187       Layer support, there are more options you can specify.
188
189       SASL_MECH <mechanism>
190              Specifies the SASL mechanism to use.  This is a user-only
191              option.
192
193       SASL_REALM <realm>
194              Specifies the SASL realm.  This is a user-only option.
195
196       SASL_AUTHCID <authcid>
197              Specifies the authentication identity.  This is  a  user-
198              only option.
199
200       SASL_AUTHZID <authcid>
201              Specifies  the  proxy  authorization identity.  This is a
202              user-only option.
203
204       SASL_SECPROPS <properties>
205              Specifies Cyrus SASL security  properties.  The  <proper‐
206              ties>  can  be specified as a comma-separated list of the
207              following:
208
209              none   (without any other properties) causes the  proper‐
210                     ties   defaults   ("noanonymous,noplain")   to  be
211                     cleared.
212
213              noplain
214                     disables mechanisms susceptible to simple  passive
215                     attacks.
216
217              noactive
218                     disables mechanisms susceptible to active attacks.
219
220              nodict disables mechanisms susceptible to passive dictio‐
221                     nary attacks.
222
223              noanonymous
224                     disables mechanisms which support anonymous login.
225
226              forwardsec
227                     requires forward secrecy between sessions.
228
229              passcred
230                     requires mechanisms which pass client  credentials
231                     (and  allows mechanisms which can pass credentials
232                     to do so).
233
234              minssf=<factor>
235                     specifies the minimum acceptable security strength
236                     factor  as  an integer approximating the effective
237                     key length used for encryption.  0 (zero)  implies
238                     no  protection,  1  implies  integrity  protection
239                     only, 56 allows DES or  other  weak  ciphers,  112
240                     allows  triple  DES  and other strong ciphers, 128
241                     allows  RC4,  Blowfish  and  other  modern  strong
242                     ciphers.  The default is 0.
243
244              maxssf=<factor>
245                     specifies the maximum acceptable security strength
246                     factor as an  integer  (see  minssf  description).
247                     The default is INT_MAX.
248
249              maxbufsize=<factor>
250                     specifies  the maximum security layer receive buf‐
251                     fer size allowed.   0  disables  security  layers.
252                     The default is 65536.
253

GSSAPI OPTIONS

255       If  OpenLDAP is built with Generic Security Services Application
256       Programming Interface support, there are more  options  you  can
257       specify.
258
259       GSSAPI_SIGN <on/true/yes/off/false/no>
260              Specifies  if GSSAPI signing (GSS_C_INTEG_FLAG) should be
261              used.  The default is off.
262
263       GSSAPI_ENCRYPT <on/true/yes/off/false/no>
264              Specifies  if  GSSAPI  encryption  (GSS_C_INTEG_FLAG  and
265              GSS_C_CONF_FLAG) should be used. The default is off.
266
267       GSSAPI_ALLOW_REMOTE_PRINCIPAL <on/true/yes/off/false/no>
268              Specifies  if GSSAPI based authentification should try to
269              form the target principal name out of the ldapServiceName
270              or  dnsHostName  attribute  of the targets RootDSE entry.
271              The default is off.
272

TLS OPTIONS

274       If OpenLDAP is built  with  Transport  Layer  Security  support,
275       there  are more options you can specify.  These options are used
276       when an ldaps:// URI is selected (by default  or  otherwise)  or
277       when the application negotiates TLS by issuing the LDAP StartTLS
278       operation.
279
280       TLS_CACERT <filename>
281              Specifies the file that contains certificates for all  of
282              the Certificate Authorities the client will recognize.
283
284       TLS_CACERTDIR <path>
285              Specifies  the path of a directory that contains Certifi‐
286              cate Authority certificates in separate individual files.
287              The  TLS_CACERT is always used before TLS_CACERTDIR.  The
288              specified directory must  be  managed  with  the  OpenSSL
289              c_rehash utility.  This parameter is ignored with GNUtls.
290
291       TLS_CERT <filename>
292              Specifies  the file that contains the client certificate.
293              This is a user-only option.
294
295       TLS_KEY <filename>
296              Specifies the file that contains  the  private  key  that
297              matches the certificate stored in the TLS_CERT file. Cur‐
298              rently, the private key must  not  be  protected  with  a
299              password,  so  it  is of critical importance that the key
300              file is protected carefully.  This is a user-only option.
301
302       TLS_CIPHER_SUITE <cipher-suite-spec>
303              Specifies acceptable cipher suite and  preference  order.
304              <cipher-suite-spec>  should be a cipher specification for
305              OpenSSL, e.g., HIGH:MEDIUM:+SSLv2.
306
307              To check what ciphers a given spec selects, use:
308
309                   openssl ciphers -v <cipher-suite-spec>
310
311              To obtain the list of ciphers in GNUtls use:
312
313                   gnutls-cli -l
314
315       TLS_RANDFILE <filename>
316              Specifies the  file  to  obtain  random  bits  from  when
317              /dev/[u]random  is  not  available.  Generally set to the
318              name of the EGD/PRNGD socket.  The  environment  variable
319              RANDFILE  can also be used to specify the filename.  This
320              parameter is ignored with GNUtls.
321
322       TLS_REQCERT <level>
323              Specifies what checks to perform on  server  certificates
324              in a TLS session, if any. The <level> can be specified as
325              one of the following keywords:
326
327              never  The client will not request or  check  any  server
328                     certificate.
329
330              allow  The  server  certificate  is requested. If no cer‐
331                     tificate is provided, the  session  proceeds  nor‐
332                     mally.  If  a bad certificate is provided, it will
333                     be ignored and the session proceeds normally.
334
335              try    The server certificate is requested.  If  no  cer‐
336                     tificate  is  provided,  the session proceeds nor‐
337                     mally. If a bad certificate is provided, the  ses‐
338                     sion is immediately terminated.
339
340              demand | hard
341                     These keywords are equivalent. The server certifi‐
342                     cate is requested. If no certificate is  provided,
343                     or  a  bad certificate is provided, the session is
344                     immediately terminated. This is the  default  set‐
345                     ting.
346
347       TLS_CRLCHECK <level>
348              Specifies if the Certificate Revocation List (CRL) of the
349              CA should be used to verify if  the  server  certificates
350              have not been revoked. This requires TLS_CACERTDIR param‐
351              eter to be set. This parameter is  ignored  with  GNUtls.
352              <level>  can  be  specified  as one of the following key‐
353              words:
354
355              none   No CRL checks are performed
356
357              peer   Check the CRL of the peer certificate
358
359              all    Check the CRL for a whole certificate chain
360
361       TLS_CRLFILE <filename>
362              Specifies the file containing  a  Certificate  Revocation
363              List to be used to verify if the server certificates have
364              not been revoked. This parameter is only  supported  with
365              GNUtls.
366

ENVIRONMENT VARIABLES

368       LDAPNOINIT
369              disable all defaulting
370
371       LDAPCONF
372              path of a configuration file
373
374       LDAPRC basename of ldaprc file in $HOME or $CWD
375
376       LDAP<option-name>
377              Set <option-name> as from ldap.conf
378

FILES

380       /etc/openldap/ldap.conf
381              system-wide ldap configuration file
382
383       $HOME/ldaprc, $HOME/.ldaprc
384              user ldap configuration file
385
386       $CWD/ldaprc
387              local ldap configuration file
388

SEE ALSO

390       ldap(3), ldap_set_option(3), ldap_result(3), openssl(1), sasl(3)
391

AUTHOR

393       Kurt Zeilenga, The OpenLDAP Project
394

ACKNOWLEDGEMENTS

396       OpenLDAP  Software  is  developed and maintained by The OpenLDAP
397       Project  <http://www.openldap.org/>.    OpenLDAP   Software   is
398       derived from University of Michigan LDAP 3.3 Release.
399
400
401
402OpenLDAP 2.4.23                   2010/06/30                      LDAP.CONF(5)
Impressum