Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

passwordless login with heimdal (kerberos) on openssh 4.2p1

Subject: passwordless login with heimdal (kerberos) on openssh 4.2p1
Date: Fri, 28 Oct 2005 10:06:28 +0200
Hi,

I'm using the openssh-server (4.2p1-5) package under Debian which contains 
openssh 4.2 with the GSSAPI patch.
I'm trying to use a kerberos ticket (obtained with kinit) to ssh into a
server without having to type any password (and without using ssh keys)

However, the closest I have come to this, is that the server asks me for
my kerberos password and then auhenticates with the kdc using my
password.

My full sshd_config (server) is this :

    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 600
    PermitRootLogin yes
    StrictModes yes
    RSAAuthentication yes
    PubkeyAuthentication yes
    IgnoreRhosts yes
    RhostsRSAAuthentication no
    HostbasedAuthentication no
    PermitEmptyPasswords no
    PasswordAuthentication no
    GSSAPICleanupCredentials yes
    GSSAPIAuthentication yes
    X11Forwarding no
    X11DisplayOffset 10
    PrintMotd no
    PrintLastLog yes
    KeepAlive yes
    Subsystem sftp /usr/lib/openssh/sftp-server
    UsePAM yes


my full ssh_config (client) is this:

    Host *
        SendEnv LANG LC_*
        HashKnownHosts yes
        GSSAPIAuthentication yes
        GSSAPIDelegateCredentials yes

On the KDC, I have a principal for my user and for the host I want to ssh into

This is what I get when I try to login (bella is the client, dhcp-103 is the 
server, u0036393 is the user):

    deepstar@bella:~$ klist 
    Credentials cache: FILE:/tmp/krb5cc_1000
            Principal: u0036393@KULEUVEN.BE

      Issued           Expires          Principal                       
    Oct 28 09:40:06  Oct 28 19:40:04  krbtgt/KULEUVEN.BE@KULEUVEN.BE    
    Oct 28 09:40:06  Oct 28 19:40:04  krbtgt/KULEUVEN.BE@KULEUVEN.BE    
    Oct 28 09:40:30  Oct 28 19:40:04  host/dhcp-103.kulnet-l@KULEUVEN.BE

       V4-ticket file: /tmp/tkt1000
    klist: No ticket file (tf_util)
    deepstar@bella:~$ ssh -vvv u0036393@dhcp-103.kulnet-l
    OpenSSH_4.2p1 Debian-5, OpenSSL 0.9.8a 11 Oct 2005
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to dhcp-103.kulnet-l [192.168.2.103] port 22.
    debug1: Connection established.
    debug1: identity file /home/deepstar/.ssh/identity type -1
    debug1: identity file /home/deepstar/.ssh/id_rsa type -1
    debug1: identity file /home/deepstar/.ssh/id_dsa type -1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_4.2p1 
Debian-5
    debug1: match: OpenSSH_4.2p1 Debian-5 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_4.2p1 Debian-5
    debug2: fd 3 setting O_NONBLOCK
    debug3: Trying to reverse map address 192.168.2.103.
    debug1: Offering GSSAPI proposal: 
gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-group1-sha1-A/vxljAEU54gt9a48EiANQ==
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: 
gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-group1-sha1-A/vxljAEU54gt9a48EiANQ==,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,null
    debug2: kex_parse_kexinit: 
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: 
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: 
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: 
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: first_kex_follows 0 
    debug2: kex_parse_kexinit: reserved 0 
    debug2: kex_parse_kexinit: 
diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: 
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: 
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit: 
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: 
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: first_kex_follows 0 
    debug2: kex_parse_kexinit: reserved 0 
    debug2: mac_init: found hmac-md5
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug2: mac_init: found hmac-md5
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    debug2: dh_gen_key: priv key bits set: 117/256
    debug2: bits set: 504/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: check_host_in_hostfile: filename /home/deepstar/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 11
    debug3: check_host_in_hostfile: filename /home/deepstar/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 9
    debug1: Host 'dhcp-103.kulnet-l' is known and matches the RSA host key.
    debug1: Found key in /home/deepstar/.ssh/known_hosts:11
    debug2: bits set: 500/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/deepstar/.ssh/identity ((nil))
    debug2: key: /home/deepstar/.ssh/id_rsa ((nil))
    debug2: key: /home/deepstar/.ssh/id_dsa ((nil))
    debug1: Authentications that can continue: 
publickey,gssapi-keyx,gssapi-with-mic,keyboard-interactive
    debug3: start over, passed a different list 
publickey,gssapi-keyx,gssapi-with-mic,keyboard-interactive
    debug3: preferred 
gssapi-keyx,gssapi-with-mic,gssapi,publickey,keyboard-interactive,password
    debug3: authmethod_lookup gssapi-keyx
    debug3: remaining preferred: 
gssapi-with-mic,gssapi,publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-keyx
    debug1: Next authentication method: gssapi-keyx
    debug1: No valid Key exchange context
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup gssapi-with-mic
    debug3: remaining preferred: gssapi,publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-with-mic
    debug1: Next authentication method: gssapi-with-mic
    debug2: we sent a gssapi-with-mic packet, wait for reply
    debug1: Authentications that can continue: 
publickey,gssapi-keyx,gssapi-with-mic,keyboard-interactive
    debug2: we sent a gssapi-with-mic packet, wait for reply
    debug1: Authentications that can continue: 
publickey,gssapi-keyx,gssapi-with-mic,keyboard-interactive
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/deepstar/.ssh/identity
    debug3: no such identity: /home/deepstar/.ssh/identity
    debug1: Trying private key: /home/deepstar/.ssh/id_rsa
    debug3: no such identity: /home/deepstar/.ssh/id_rsa
    debug1: Trying private key: /home/deepstar/.ssh/id_dsa
    debug3: no such identity: /home/deepstar/.ssh/id_dsa
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup keyboard-interactive
    debug3: remaining preferred: password
    debug3: authmethod_is_enabled keyboard-interactive
    debug1: Next authentication method: keyboard-interactive
    debug2: userauth_kbdint
    debug2: we sent a keyboard-interactive packet, wait for reply
    debug2: input_userauth_info_req
    debug2: input_userauth_info_req: num_prompts 1
    Password for u0036393@KULEUVEN.BE: 

The problem is probably here:

    debug1: Next authentication method: gssapi-keyx
    debug1: No valid Key exchange context
    debug2: we did not send a packet, disable method

Althrough I have no idea what is causing it.

I would appreciate any help to get this working.
Also, some documentation on how this can be accomplished would be very nice.
(If there already is such documentation, it would be helpful if it was in a 
more accesible place and if it could be found through google :)

thanks in advance

greets,
-- Steven

<Prev in Thread] Current Thread [Next in Thread>
  • passwordless login with heimdal (kerberos) on openssh 4.2p1, Steven Van Acker <=