Changes for page KerberosAndLDAP
Last modified by Sirius Rayner-Karlsson on 2024/05/09 10:54
From version 22.1
edited by Sirius Rayner-Karlsson
on 2024/05/06 02:42
on 2024/05/06 02:42
Change comment:
There is no comment for this version
To version 24.1
edited by Sirius Rayner-Karlsson
on 2024/05/06 02:55
on 2024/05/06 02:55
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,32 +2,38 @@ 1 -(% align="right" %) 2 2 {{toc/}} 3 3 4 4 = Debian = 5 5 6 -The guide I followed was https://wiki.debian.org/LDAP/OpenLDAPSetup#Kerberos [[https://wiki.debian.org/LDAP/OpenLDAPSetup#Kerberos]]which while it worked required some minor tweaks. I obtained edit privileges for the Debian Wiki and updated the guide with the fixes that I found. I however have a Synology NAS and that can run an LDAP Server. So this guide differs a little from the upstream Debian Guide.5 +The guide I followed was https://wiki.debian.org/LDAP/OpenLDAPSetup#Kerberos which while it worked required some minor tweaks. I obtained edit privileges for the Debian Wiki and updated the guide with the fixes that I found. I however have a Synology NAS and that can run an LDAP Server. So this guide differs a little from the upstream Debian Guide. 7 7 8 -I will assume that you have installed the LDAP Server package on your NAS and gone through initial configuration steps, so it has a domain, there is a DN you can bind as and so forth. The Synology NAS can be leveraged for a multitude of things, and running DNS, DHCP, WebServices and Containers are but a few. 7 +I will assume that you have installed the LDAP Server package on your NAS and gone through initial configuration steps, so it has a domain, there is a DN you can bind as and so forth. The Synology NAS can be leveraged for a multitude of things, and running DNS, DHCP, WebServices and Containers are but a few. I will also assume you have a Debian system (12.5 or later, though this guide should work with 11.x and likely 10.x as well) that will become your KDC and KAdmin server. 9 9 9 +I also recommend that you create actual ~#~#.ldif~#~# files rather than use here-documents as used in this guide. It is far easier to make adjustments to things if you have a file to edit rather than having to type it all out again or paste it and then have to try and make edits to it without making mistakes. The guide is for illustration and expectation is that you do not follow it verbatim but adapt it to your needs. 10 10 11 -First, install the packages containing the LDAP-enabled Kerberos servers ([[krb5-kdc-ldap>>url:https://packages.debian.org/krb5-kdc-ldap]] and [[krb5-admin-server>>url:https://packages.debian.org/krb5-admin-server]]) and the [[schema2ldif>>url:https://packages.debian.org/schema2ldif]] tool on your Debian host: 12 12 12 +===== Install the packages containing the LDAP-enabled Kerberos servers: ===== 13 + 14 +(% class="wikigeneratedid" %) 15 +The packages you need are [[krb5-kdc-ldap>>url:https://packages.debian.org/krb5-kdc-ldap]], [[krb5-admin-server>>url:https://packages.debian.org/krb5-admin-server]] and [[schema2ldif>>url:https://packages.debian.org/schema2ldif]] . 16 + 13 13 (% style="color:#400" %) 14 14 ##{{{$ sudo apt install krb5-kdc-ldap krb5-admin-server schema2ldif}}}## 15 15 16 16 17 - Thenload the ##kerberos## schema:21 +===== Load the ##kerberos## schema into the LDAP server on your Synology: ===== 18 18 19 19 (% style="color:#400" %) 20 -##{{{$ zcat /usr/share/doc/krb5-kdc-ldap/kerberos.openldap.ldif.gz | ldapadd -H ldap://nas. fqdn/ -D uid=root,cn=users,dc=example,dc=com -W}}}##24 +##{{{$ zcat /usr/share/doc/krb5-kdc-ldap/kerberos.openldap.ldif.gz | ldapadd -H ldap://nas.example.com/ -D uid=root,cn=users,dc=example,dc=com -W}}}## 21 21 ##{{{Enter LDAP Password:}}}## 22 22 ##{{{adding new entry "cn=kerberos,cn=schema,cn=config"}}}## 23 23 ##{{{$}}}## 24 24 25 25 26 - Havinganindex onthe ##krbPrincipalName## improves performance and also suppresses some log messages if ##slapd## is configured to log more than default for the database(s) where you intend to store Kerberos data. As this is OpenLDAP on the Synology, it does not use ##mdb## format, it uses ##bdb##:30 +===== Create Index on krbPrincipalName: ===== 27 27 32 +Having an index on the ##krbPrincipalName## improves performance and also suppresses some log messages if ##slapd## is configured to log more than default for the database(s) where you intend to store Kerberos data. As this is OpenLDAP on the Synology, it does not use ~#~###mdb~#~### format, it uses ##~#~#bdb~#~###. If you install ~#~#slapd~#~# on Debian, it uses ~#~#mdb~#~# format. 33 + 28 28 (% style="color:#400" %) 29 -##{{{$ ldapmodify -H ldap://nas. fqdn/ -D uid=root,cn=users,dc=example,dc=com -W <<EOF}}}##35 +##{{{$ ldapmodify -H ldap://nas.example.com/ -D uid=root,cn=users,dc=example,dc=com -W <<EOF}}}## 30 30 ##{{{dn: olcDatabase={1}bdb,cn=config}}}## 31 31 ##{{{add: olcDbIndex}}}## 32 32 ##{{{olcDbIndex: krbPrincipalName eq,pres,sub}}}## ... ... @@ -36,6 +36,8 @@ 36 36 ##{{{$}}}## 37 37 38 38 45 +===== Create the two principals ~#~#kadmin~#~# and ~#~#kdc~#~#: ===== 46 + 39 39 Next, you need to create and configure two entries which will be used by the Kerberos servers to connect to OpenLDAP. As you will not run the Kerberos KDC and Admin Server on the same host as OpenLDAP, these steps are required. In order to keep things nicely separated, everything will be created under a separate ##organizationalUnit##. 40 40 41 41 (% style="color:#400" %)