r***@live.com
2013-11-13 11:28:30 UTC
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
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