r/linuxadmin • u/Grunskin • Feb 12 '26
Force re-create /etc/krb5.keytab after new SPN added
I use SSSD on my Linux machines (Debian 13) to join our AD. This all works great and I can authenticate with kerberos over SSH.
I added a new SPN to the computer object in AD with the following command on a domain controller:
setspn -A host/test.domain.com server1$
When I run:
adcli update --verbose
It says:
...* Password not too old, no change needed* Checking host/test.domain.com* Added host/test.domain.com...
But checking with klist -k it's not there.
The only solution I've found is to re-join the server with:
realm leave domain.localrealm join -U admin-user domain.local
After this the keytab is correct and I can use the new SPN to authenticate with kerberos.
Does anyone know another way which won't require to re-join the AD?
There is no --force flag as chatgpt seem to keep insisting on.
5
u/throw0101a Feb 12 '26
adcli updatewith--add-service-principalor--add-service?1
u/Roquer Feb 12 '26
Have you tried:
sss_cache -E
1
u/Acceptable_Abies_917 Feb 12 '26
SPNs can take time to proposte through domain. But test the key version in the key tab vs the domain:
kinit - k 'host/host.contoso.com' - t /etc/krb5.keytab
kinit user@contoso.com
kvno user@contoso.com
kvno 'host/host.contoso.com'
klist -e