On Sun, Apr 24, 2011 at 1:13 AM, Paul Ebermann <paul-eberm...@gmx.de> wrote:
> Shai Ayal skribis:
> > 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.
>
> The important part of the protocol seems to be this:
>
> > 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
>
> For some reason, there is something sent with length 33 instead of 35.
>
> Could you show the Java code you are using to load the identity and
> connect?
>
>
There is not much to the code:
jsch = new JSch();
if (ci.getKeypath().length() > 0) {
jsch.addIdentity(ci.getKeypath());
}
session = jsch.getSession(ci.getUser(), ci.getHost(), ci.getPort());
session.setUserInfo(ci);
session.connect();
where ci implements UserInfo, but also has additional fields for the
privatekey file etc...
Maybe this is a problem because the keu is in DSA format and not RSA format?
Shai
------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users