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
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users