1 Configuring Kerberos with OpenLDAP back-end
2 ===========================================
4 .. seealso:: :ref:`ldap_be_ubuntu`
6 1. Set up SSL on the OpenLDAP server and client to ensure secure
7 communication when the KDC service and LDAP server are on different
8 machines. ``ldapi\://`` can be used if the LDAP server and KDC
9 service are running on the same machine.
11 A. Setting up SSL on the OpenLDAP server:
13 i) Get a CA certificate using OpenSSL tools
14 ii) Configure OpenLDAP server for using SSL/TLS
16 For the latter, you need to specify the location of CA
17 certificate location in *slapd.conf* file.
19 Refer to the following link for more information:
20 http://www.openldap.org/doc/admin23/tls.html
22 B. Setting up SSL on OpenLDAP Client:
24 i) For the KDC and Admin Server, you need to do the client-side
25 configuration in ldap.conf. For example::
27 TLS_CACERT /etc/openldap/certs/cacert.pem
29 2. Include the Kerberos schema file (kerberos.schema) in the
30 configuration file (slapd.conf) on the LDAP Server, by providing
31 the location where it is stored::
33 include /etc/openldap/schema/kerberos.schema
35 3. Choose DNs for the :ref:`krb5kdc(8)` and :ref:`kadmind(8)` servers
36 to bind to the LDAP server, and create them if necessary. These DNs
37 will be specified with the **ldap_kdc_dn** and **ldap_kadmind_dn**
38 directives in :ref:`krb5.conf(5)`; their passwords can be stashed
39 with "``kdb5_ldap_util stashsrvpw``" and the resulting file
40 specified with the **ldap_service_password_file** directive.
42 4. Choose a DN for the global Kerberos container entry (but do not
43 create the entry at this time). This DN will be specified with the
44 **ldap_kerberos_container_dn** directive in :ref:`krb5.conf(5)`.
45 Realm container entries will be created underneath this DN.
46 Principal entries may exist either underneath the realm container
47 (the default) or in separate trees referenced from the realm
50 5. Configure the LDAP server ACLs to enable the KDC and kadmin server
51 DNs to read and write the Kerberos data.
53 Sample access control information::
58 access to dn.base="cn=Subschema"
61 access to attrs=userPassword,userPKCS12
65 access to attrs=shadowLastChange
69 # Providing access to realm container
70 access to dn.subtree= "cn=EXAMPLE.COM,cn=krbcontainer,dc=example,dc=com"
71 by dn.exact="cn=kdc-service,dc=example,dc=com" read
72 by dn.exact="cn=adm-service,dc=example,dc=com" write
75 # Providing access to principals, if not underneath realm container
76 access to dn.subtree= "ou=users,dc=example,dc=com"
77 by dn.exact="cn=kdc-service,dc=example,dc=com" read
78 by dn.exact="cn=adm-service,dc=example,dc=com" write
84 If the locations of the container and principals or the DNs of
85 the service objects for a realm are changed then this
86 information should be updated.
88 6. Start the LDAP server as follows::
90 slapd -h "ldapi:/// ldaps:///"
92 7. Modify the :ref:`krb5.conf(5)` file to include LDAP specific items
103 ldap_service_password_file
105 ldap_conns_per_server
107 8. Create the realm using :ref:`kdb5_ldap_util(8)` (see
108 :ref:`ldap_create_realm`)::
110 kdb5_ldap_util -D cn=admin,dc=example,dc=com create -subtrees ou=users,dc=example,dc=com -r EXAMPLE.COM -s
112 Use the **-subtrees** option if the principals are to exist in a
113 separate subtree from the realm container. Before executing the
114 command, make sure that the subtree mentioned above
115 ``(ou=users,dc=example,dc=com)`` exists. If the principals will
116 exist underneath the realm container, omit the **-subtrees** option
117 and do not worry about creating the principal subtree.
119 For more information, refer to the section :ref:`ops_on_ldap`.
121 The realm object is created under the
122 **ldap_kerberos_container_dn** specified in the configuration file.
123 This operation will also create the Kerberos container, if not
124 present already. This will be used to store information related to
127 9. Stash the password of the service object used by the KDC and
128 Administration service to bind to the LDAP server using the
129 :ref:`kdb5_ldap_util(8)` **stashsrvpw** command (see
130 :ref:`stash_ldap`). The object DN should be the same as
131 **ldap_kdc*_dn* and **ldap_kadmind_dn** values specified in the
132 :ref:`krb5.conf(5)` file::
134 kdb5_ldap_util -D cn=admin,dc=example,dc=com stashsrvpw -f /etc/kerberos/service.keyfile cn=krbadmin,dc=example,dc=com
136 10. Add ``krbPrincipalName`` to the indexes in slapd.conf to speed up
139 With the LDAP back end it is possible to provide aliases for principal
140 entries. Currently we provide no mechanism provided for creating
141 aliases, so it must be done by direct manipulation of the LDAP
144 An entry with aliases contains multiple values of the
145 *krbPrincipalName* attribute. Since LDAP attribute values are not
146 ordered, it is necessary to specify which principal name is canonical,
147 by using the *krbCanonicalName* attribute. Therefore, to create
148 aliases for an entry, first set the *krbCanonicalName* attribute of
149 the entry to the canonical principal name (which should be identical
150 to the pre-existing *krbPrincipalName* value), and then add additional
151 *krbPrincipalName* attributes for the aliases.
153 Principal aliases are only returned by the KDC when the client
154 requests canonicalization. Canonicalization is normally requested for
155 service principals; for client principals, an explicit flag is often
156 required (e.g. ``kinit -C``) and canonicalization is only performed
157 for initial ticket requests.