Discussion:
[JSch-users] Algorithm negotiation fail Exception while doing SFTP
r***@live.com
2013-11-13 11:28:30 UTC
Permalink
Hi Team,
I trying below code to start a SFTP session for file transfer(from linux to windows server). String dstDirectory = "****";
JSch jsch = new JSch();
session = jsch.getSession("*****", "******", 22);
session.setConfig("StrictHostKeyChecking", "yes");
session.setPassword("******");
session.connect();


channel = session.openChannel("sftp");
channel.connect();
sftpChannel = (ChannelSftp) channel;
sftpChannel.put(file, dstDirectory);
sftpChannel.exit();
session.disconnect();
Getting the below exceptions while connecting,
Exception in thread "main" com.jcraft.jsch.JSchException: Algorithm negotiation fail at com.jcraft.jsch.Session.receive_kexinit(Session.java:559) at com.jcraft.jsch.Session.connect(Session.java:299) at com.jcraft.jsch.Session.connect(Session.java:162) at sample.SFTP.main(SFTP.java:35)
I even tried with StrictHostKeyChecking=no, but does not help.Please let me know if there are any more configurations to be set in the code for this.
Thanks,Rakesh
Atsuhiko Yamanaka
2013-11-20 04:20:33 UTC
Permalink
Hi,

+-From: <***@live.com> ---------------
|_Date: Wed, 13 Nov 2013 11:28:30 +0000 __
|
|Getting the below exceptions while connecting
|Exception in thread "main" com.jcraft.jsch.JSchException: Algorithm
|negotiation fail
...

Try http://www.jcraft.com/jsch/examples/Logger.java
You may find a reason for that exception in its output.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
Skype callto://jcraft/
Twitter: http://twitter.com/ymnk
Facebook: http://facebook.com/aymnk

Loading...