[JSch-users] Cannot connect using PubKey
Status: Alpha
Brought to you by:
ymnk
From: Shai A. <sh...@gm...> - 2011-04-23 19:10:39
|
Hi First, thank you for releasing jsch. I am trying to use it in an android application. I managed to get it running using password authentication, but when I try to use pubkey auth, it fails. I am using an openssh generated dsa private key. The output of sshd is attached below. I must add that the private key works perfectly well both using openssh and using connectbot, a ssh client on the android. Thanks again, Shai /usr/sbin/sshd -d -d debug2: load_server_config: filename /etc/ssh/sshd_config debug2: load_server_config: done config len = 717 debug2: parse_server_config: config /etc/ssh/sshd_config len 717 debug1: sshd version OpenSSH_5.8p1 Debian-4 debug1: read PEM private key done: type RSA debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048 debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048 debug1: private host key: #0 type 1 RSA debug1: read PEM private key done: type DSA debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024 debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024 debug1: private host key: #1 type 2 DSA debug1: rexec_argv[0]='/usr/sbin/sshd' debug1: rexec_argv[1]='-d' debug1: rexec_argv[2]='-d' Set /proc/self/oom_score_adj from 0 to -1000 debug2: fd 3 setting O_NONBLOCK debug1: Bind to port 22 on 0.0.0.0. Server listening on 0.0.0.0 port 22. debug2: fd 4 setting O_NONBLOCK debug1: Bind to port 22 on ::. Server listening on :: port 22. debug1: Server will not fork when running in debugging mode. debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8 debug1: inetd sockets after dupping: 3, 3 Connection from 192.168.221.105 port 53162 debug1: Client protocol version 2.0; client software version JSCH-0.1.44 debug1: no match: JSCH-0.1.44 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-4 debug2: fd 3 setting O_NONBLOCK debug2: Network child is on pid 14135 debug1: permanently_set_uid: 109/65534 debug1: list_hostkey_types: ssh-rsa,ssh-dss debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,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-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour, rij...@ly... debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour, rij...@ly... debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,um...@op... ,hmac-ripemd160,hma...@op...,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,um...@op... ,hmac-ripemd160,hma...@op...,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zl...@op... debug2: kex_parse_kexinit: none,zl...@op... 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-group1-sha1,diffie-hellman-group-exchange-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none debug2: kex_parse_kexinit: none debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: client->server aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: dh_gen_key: priv key bits set: 125/256 debug2: bits set: 516/1024 debug1: expecting SSH2_MSG_KEXDH_INIT debug2: bits set: 504/1024 debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: monitor_read: 5 used once, disabling now debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: KEX done debug1: userauth-request for user shaia service ssh-connection method none debug1: attempt 0 failures 0 debug2: parse_server_config: config reprocess config len 717 debug2: monitor_read: 7 used once, disabling now debug2: input_userauth_request: setting up authctxt for shaia debug2: input_userauth_request: try method none debug1: PAM: initializing for "shaia" debug1: PAM: setting PAM_RHOST to "192.168.221.105" debug1: PAM: setting PAM_TTY to "ssh" debug2: monitor_read: 50 used once, disabling now debug2: monitor_read: 3 used once, disabling now debug1: userauth-request for user shaia service ssh-connection method publickey debug1: attempt 1 failures 0 debug2: input_userauth_request: try method publickey debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-1023 debug1: Checking blacklist file /etc/ssh/blacklist.RSA-1023 debug1: temporarily_use_uid: 1000/1000 (e=0/0) debug1: trying public key file /home/shaia/.ssh/authorized_keys debug1: Could not open authorized keys '/home/shaia/.ssh/authorized_keys': No such file or directory debug1: restore_uid: 0/0 debug1: temporarily_use_uid: 1000/1000 (e=0/0) debug1: trying public key file /home/shaia/.ssh/authorized_keys2 debug1: fd 4 clearing O_NONBLOCK debug1: matching key found: file /home/shaia/.ssh/authorized_keys2, line 1 Found matching RSA key: 5e:d4:5b:37:bf:f5:51:77:e4:47:66:cf:e3:29:3f:90 debug1: restore_uid: 0/0 bad decrypted len: 33 != 20 + 15 debug1: ssh_rsa_verify: signature incorrect Failed publickey for shaia from 192.168.221.105 port 53162 ssh2 debug2: userauth_pubkey: authenticated 0 pkalg ssh-rsa Received disconnect from 192.168.221.105: 3: com.jcraft.jsch.JSchException: Auth fail debug1: do_cleanup debug1: do_cleanup debug1: PAM: cleanup |