Installations of Kerberos and OpenLDAP 2026
I am in the process of migrating my services to a new server (note: this article has been written on April 2026). I've already written some notes about Kerberos and OpenLDAP 9 years ago.
In this short article, I take notes about how to do this in 2026.
Kerberos installation and restoration
First in previous article I said I used the lower case version of my domain name adorsaz.org, but it seems I've changed my mind and I finally used the uppercase version ADORSAZ.ORG. If I recall correctly, that was the only way to be able to connect GNOME desktops to users in my OpenLDAP + Kerberos setup.
sudo apt install krb5-kdc krb5-admin-server
The installation process warns you should use the command
krb5_newrealm to setup the service.
Well it will ask you to give a master key (aka password) and to not forget it. Well… 7 years later I had no idea where I saved this password if I did it, maybe in a KeepassXC database I found on my disk but I were unable to open.
So I used my Vaultwarden service to generate a new master password and store it securely.
On the old server, I was still able to operate on the kerberos
database, because it still had the right
/etc/krb5kdc/stash file containing the current master key
password.
I used the Kerberos cheatsheet from openkb.info to add a new key with my password and rollover to this new key.
- add the new key with
kdb5_util add_mkey - enable it with
kdb5_util use_mkey KEY_NUMBER -
convert current database data to use this new key
kdb5_util update_princ_encryption -v -
update the stash file with the two new keys
kdb5_util stash - purge the old key
kdb5_util purge_mkeys -
update the stash file to keep only the current key
kdb5_util stash
Then I made a dump of the database with
kdb5_util dump ADORSAZ.ORG.dump, I transferred it with
the stash file to the new server.
I used kdb5_util load ADORSAZ.ORG.dump and I was able to
read the database, for example with kdb5_util list_mkeys.
During my tests, I've seen Debian Trixie were using new algorithms to create keys, so I followed once again the same key rollover process to create a new key again with latest encryption algorithms.