On Sun, Apr 24, 2011 at 8:01 AM, Shai Ayal <sha...@gmail.com> wrote:

>
>
> 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?
>
>
OK, looked a bit deeper:
I am using eclipse on linux to develop for android.

When trying out the UserAuthPubKey.java example in the same
eclipse environment, using the same jsch library with the difference being
using the linux JavaSE 1.6 instead of the android SDK, it runs perfectly,
connecting using the same private key to the same host.

This leads me to believe that android has a different java implementation
which might cause problems. Does anyone have a clue as to where jsch uses
the underlying java for something which might cause his problem?

Shai
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to