Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've set up two VMs on an "internal" (in VirtualBox meaning) network, one being a DNS server ( and the other - a KDC and Kerberos admin server ( The default and the only realm is EXAMPLE.COM. Both machines use freshly installed Debian Squeeze.

The problem: I can login via ssh on from, but I can't login via ssh from

On, sshd in debug mode says:

debug1: Unspecified GSS failure.  Minor code may provide more information
Wrong principal in request

debug1: Got no client credentials
debug3: mm_request_send entering: type 41
debug3: mm_request_receive entering
debug1: userauth-request for user tom service ssh-connection method gssapi-with-mic
debug1: attempt 2 failures 1
debug2: input_userauth_request: try method gssapi-with-mic
debug1: userauth-request for user tom service ssh-connection method gssapi-with-mic
debug1: attempt 3 failures 1
debug2: input_userauth_request: try method gssapi-with-mic

at which point the client is asked for a password. A tcpdump file processed by Wireshark shows there has been some exchange of crypted packets, but I can't deduct more as they are, well, crypted :). After 2 days of googling I'm stuck and would appreciate any help.

Even more would I appreciate any advice /links/hints on a general sane configuration debugging strategy, when it comes to Kerberos and friends. For example, I'm out of ideas where to look for what's wrong with 'Wrong principal', and what is that principal the server receives instead of the right one. Something tells me the real adventures are yet to come :).

Below are configs and diagnostic outputs. Hope I haven't forgot anything.

kdc:~# cat /etc/krb5kdc/kdc.conf 
    kdc_ports = 750,88

        database_name = /var/lib/krb5kdc/principal
        admin_keytab = FILE:/etc/krb5kdc/kadm5.keytab
        acl_file = /etc/krb5kdc/kadm5.acl
        key_stash_file = /etc/krb5kdc/stash
        kdc_ports = 750,88
        max_life = 10h 0m 0s
        max_renewable_life = 7d 0h 0m 0s
        master_key_type = des3-hmac-sha1
        supported_enctypes = aes256-cts:normal arcfour-hmac:normal des3-hmac-sha1:normal des-cbc-crc:normal des:normal des:v4 des:norealm des:onlyrealm des:afs3
        default_principal_flags = +preauth

kdc:~# kadmin.local -q 'listprincs'
Authenticating as principal root/admin@EXAMPLE.COM with password.

kdc:~# cat /etc/ssh/sshd_config |grep '^[^#]'
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
GSSAPIKeyExchange yes
GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes

/etc/krb5.conf is identical on both kdc and dns1.

dns1:~$ cat /etc/krb5.conf 
    default_realm = EXAMPLE.COM
    dns_lookup_realm = true
    dns_lookup_kdc = true 
    forwardable = true
        admin_server =
[domain_realm] = EXAMPLE.COM = EXAMPLE.COM
    kdc = FILE:/var/log/krb5kdc.log
    admin_server = FILE:/var/log/kadmin.log
    default = FILE:/var/log/krb5lib.log

The TGT is forwardable. On ssh client:

dns1:~$ klist -f
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: tom@EXAMPLE.COM

Valid starting     Expires            Service principal
01/03/12 20:00:03  01/04/12 06:00:03  krbtgt/EXAMPLE.COM@EXAMPLE.COM
    renew until 01/04/12 20:00:00, Flags: FRIA
01/03/12 20:00:21  01/04/12 06:00:03  host/
    renew until 01/04/12 20:00:00, Flags: FRAT

Keytab does also seem to be OK:

dns1:~# klist -k
Keytab name: WRFILE:/etc/krb5.keytab
KVNO Principal
---- --------------------------------------------------------------------------
   5 host/
   5 host/
   5 host/
   5 host/

DNS (incl. PTR, TXT, SRV) works as it should.

dns1:~# cat /var/cache/bind/ 
$TTL    86400
@   IN  SOA (
            2012010301  ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
              86400 )   ; Negative Cache TTL
@   IN  NS
dns1    IN  A
www IN  A
mail    IN  A
fed IN  A

kdc IN  A
;kds    IN  A

_kerberos   TXT "EXAMPLE.COM"

krb IN  CNAME   kdc

_kerberos._udp      SRV 0 0 88  kdc
_kerberos-master._udp   SRV 0 0 88  kdc
_kerberos-adm._tcp  SRV 0 0 749 kdc
_kpasswd._udp       SRV 0 0 464 kdc

dns1:~# cat /var/cache/bind/ 
$TTL    86400
@   IN  SOA (
            2012010102  ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
              86400 )   ; Negative Cache TTL
@   IN  NS
2   IN  PTR
3   IN  PTR

8   IN  PTR
9   IN  PTR
share|improve this question
You are ServerFault's 100,000th question. Sadly, we have no cake. –  Wesley Jan 3 '12 at 18:55
The cake is a lie... the cake is a lie... –  Tim Brigham Jan 3 '12 at 19:03
try configuring the realm and kdc in /etc/krb5.conf at dns1 (bypassing its kdc lookup over dns) –  yarek Jan 17 '12 at 21:59

3 Answers 3

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

kdc:~$ cat /etc/hosts   localhost
# kdc kdc

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

share|improve this answer

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.

share|improve this answer

Try this below.

edit /etc/ssh/sshd_config

find PermitRootLogin no

change PermitRootLogin => yes

command> /etc/init.d/sshd restart

share|improve this answer
Nothing in the question would suggest that this is the problem, and the OP self-answered and showed the issue is something else entirely. –  Sven Jun 20 at 8:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.