“Auth fail” in jsch-0.1.42 with Java 1.4.2

-tnt-

New Member
I have this simple Java program that uses Jsch to connect to an SFTP server. The connection fails with an "Auth fail" exception on Java 1.4.2, but it connects flawlessly on Java 1.7.\[code\]try { JSch jsch = new JSch(); jsch.setKnownHosts(KNOWN_HOSTS_PATH); jsch.addIdentity(PRIVATE_KEY_PATH, PASSPHRASE); Session session = jsch.getSession(USERNAME, HOSTNAME, 22); session.connect(2500); Channel channel = session.openChannel("shell"); channel.setInputStream(System. in ); channel.setOutputStream(System.out); channel.connect();} catch (Exception e) { e.printStackTrace(System.err);}\[/code\]The key I'm using is an \[code\]ssh-rsa 4096\[/code\] bit key. The \[code\].pub\[/code\] key file exists in the same directory as the private key.When connecting a logger, I see the following messages before the exception (which occurs on \[code\]channel.connect();\[/code\]):INFO: Connecting to <redacted> port 22INFO: Connection establishedINFO: Remote version string: SSH-2.0-OpenSSH_5.1p1 Debian-5INFO: Local version string: SSH-2.0-JSCH-0.1.42INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256INFO: arcfour is not available.INFO: arcfour128 is not available.INFO: arcfour256 is not available.INFO: SSH_MSG_KEXINIT sentINFO: SSH_MSG_KEXINIT receivedINFO: kex: server->client aes128-ctr hmac-md5 noneINFO: kex: client->server aes128-ctr hmac-md5 noneINFO: SSH_MSG_KEXDH_INIT sentINFO: expecting SSH_MSG_KEXDH_REPLYINFO: ssh_rsa_verify: signature trueINFO: Host '<redacted>' is known and mathces the RSA host keyINFO: SSH_MSG_NEWKEYS sentINFO: SSH_MSG_NEWKEYS receivedINFO: SSH_MSG_SERVICE_REQUEST sentINFO: SSH_MSG_SERVICE_ACCEPT receivedINFO: Authentications that can continue: publickey,keyboard-interactive,passwordINFO: Next authentication method: publickeyINFO: Authentications that can continue: passwordINFO: Next authentication method: passwordINFO: Disconnecting from <redacted> port 22com.jcraft.jsch.JSchException: Auth fail at com.jcraft.jsch.Session.connect(Session.java:452) at TestJsch.main(TestJsch.java:19)When I run the same program with Java 1.7, it saysINFO: Connecting to <redacted> port 22INFO: Connection establishedINFO: Remote version string: SSH-2.0-OpenSSH_5.1p1 Debian-5INFO: Local version string: SSH-2.0-JSCH-0.1.42INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256INFO: SSH_MSG_KEXINIT sentINFO: SSH_MSG_KEXINIT receivedINFO: kex: server->client aes128-ctr hmac-md5 noneINFO: kex: client->server aes128-ctr hmac-md5 noneINFO: SSH_MSG_KEXDH_INIT sentINFO: expecting SSH_MSG_KEXDH_REPLYINFO: ssh_rsa_verify: signature trueINFO: Host '<redacted>' is known and mathces the RSA host keyINFO: SSH_MSG_NEWKEYS sentINFO: SSH_MSG_NEWKEYS receivedINFO: SSH_MSG_SERVICE_REQUEST sentINFO: SSH_MSG_SERVICE_ACCEPT receivedINFO: Authentications that can continue: publickey,keyboard-interactive,passwordINFO: Next authentication method: publickeyINFO: Authentication succeeded (publickey).Linux <redacted> 2.6.26-2-amd64 #1 SMP Mon Jun 13 16:29:33 UTC 2011 x86_64<server welcome message follows>I have installed the Java Cryptography Extensions (JCE) for the 1.4 VM.What could be the source of that problem?
 
Top