Wrong principal in request (SSH/ GSSAPI/Kerberos/Debian)

Solution 1:

Found this while Googling for exactly the same error on a new server build - pointed me in the right direction :)

In my case, I had incorrect reverse DNS - when I updated this and cleared my caching nameservers' caches, it worked.

Solution 2:

I have to be more attentive. There was a line left in /etc/hosts resolving 127.0.0.1 to FQDN (now commented out):

kdc:~$ cat /etc/hosts
127.0.0.1   localhost
#127.0.0.1  kdc.example.com kdc
172.16.3.3  kdc.example.com kdc

After purging the related principals from DB and keytab and restarting both VMs, everything works as desired. Ufff...