I downloaded a new JSch 0.1.53 library and JSch (sftp) download task no longer works. This release fails on session.connect()
function throwing an error S
The JSch 0.1.53 supports (and prefers) the diffie-hellman-group-exchange-sha256
KEX, what the server claims to support too, so the JSch tries to use it.
For some reason the server disconnects you afterwards.
To workaround that, force the JSch to use the diffie-hellman-group1-sha1
KEX, what the JSch 0.1.52 prefers:
session.setConfig("kex", "diffie-hellman-group1-sha1");
I had an same problem i just changed the jsch version to 0.1.54 and got solved
add this to your pom.xml
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.54</version>
</dependency>
After trying out many solutions, below solved my issue
Open ssh server's sshd_config in a text editor and add below line to the end of the file:
KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
After editing the file ensure you restart you ssh service