i have a simple client that opens a reverse port forward to a server. i've
included Jsch into my android project. it works fine for android 2.3
devices, but fails on android 2.2 and android 2.1. the error is "auth
failed". i'm using key auth as you can see below. any idea what is going
on?
here's my code,
JSch.setLogger(new AndroidLogger());
JSch jsch = new JSch();
String user = config.getUser();
Log.d("xxx", "user: " + user);
File pvtFile = new Keys(context).getPvtKeyFile();
Log.d("xxx", "using private key file: " + pvtFile);
jsch.addIdentity(pvtFile.toString());
session = jsch.getSession(user, this.reservation.getHost(), 22);
int rport = this.reservation.getPort();
String lhost = "localhost";
int lport = this.localPort;
UserInfo ui = new MyUserInfo();
session.setUserInfo(ui);
session.setServerAliveInterval(2000);
session.connect();
channel = session.openChannel("session");
channel.connect();
session.setPortForwardingR(rport, lhost, lport);
and here's the log,
D/xxx( 2506): using user: tunnel
D/xxx( 2506): using private key file: XXX
D/dalvikvm( 2506): GC freed 3434 objects / 283696 bytes in 33ms
I/jsch ( 2506): Connecting to XXX port 22
I/jsch ( 2506): Connection established
I/jsch ( 2506): Remote version string: SSH-2.0-OpenSSH_5.3p1
Debian-3ubuntu3
I/jsch ( 2506): Local version string: SSH-2.0-JSCH-0.1.44
I/jsch ( 2506): CheckCiphers:
aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
I/jsch ( 2506): arcfour is not available.
I/jsch ( 2506): arcfour128 is not available.
I/jsch ( 2506): arcfour256 is not available.
I/jsch ( 2506): SSH_MSG_KEXINIT sent
I/jsch ( 2506): SSH_MSG_KEXINIT received
I/jsch ( 2506): kex: server->client aes128-ctr hmac-md5 none
I/jsch ( 2506): kex: client->server aes128-ctr hmac-md5 none
I/jsch ( 2506): SSH_MSG_KEXDH_INIT sent
I/jsch ( 2506): expecting SSH_MSG_KEXDH_REPLY
I/jsch ( 2506): ssh_rsa_verify: signature true
W/jsch ( 2506): Permanently added 'XXX' (RSA) to the list of known hosts.
I/jsch ( 2506): SSH_MSG_NEWKEYS sent
I/jsch ( 2506): SSH_MSG_NEWKEYS received
I/jsch ( 2506): SSH_MSG_SERVICE_REQUEST sent
I/jsch ( 2506): SSH_MSG_SERVICE_ACCEPT received
I/jsch ( 2506): Authentications that can continue:
publickey,keyboard-interactive,password
I/jsch ( 2506): Next authentication method: publickey
I/jsch ( 2506): Disconnecting from XXX.com port 22
E/xxx( 2506): error opening tunnel
E/xxx( 2506): com.jcraft.jsch.JSchException: Auth fail
E/xxx( 2506): at com.jcraft.jsch.Session.connect(Session.java:461)
E/xxx( 2506): at com.jcraft.jsch.Session.connect(Session.java:154)
E/xxx( 2506): at
com.sonyericsson.incubator.android.tunnel.Tunnel.open(Tunnel.java:112)
E/xxx( 2506): at
com.sonyericsson.incubator.android.tunnel.TunnelService$6.run(TunnelService.java:322)
E/xxx( 2506): at java.lang.Thread.run(Thread.java:1096)
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users