As of version 0.2.0, the RSA/SHA1 signature algorithm is disabled by default for security. If your server only supports RSA/SHA1, you can re-enable it using one of these methods:
1. Globally via JSch configuration:
JSch.setConfig("server_host_key", JSch.getConfig("server_host_key") + ",ssh-rsa");
JSch.setConfig("PubkeyAcceptedAlgorithms", JSch.getConfig("PubkeyAcceptedAlgorithms") + ",ssh-rsa");
2. Per-session basis:
session.setConfig("server_host_key", session.getConfig("server_host_key") + ",ssh-rsa");
session.setConfig("PubkeyAcceptedAlgorithms", session.getConfig("PubkeyAcceptedAlgorithms") + ",ssh-rsa");
3. Via OpenSSH config file:
Add ssh-rsa to the HostKeyAlgorithms and PubkeyAcceptedAlgorithms keywords in your config file and use the OpenSSHConfig class.
// Global configuration example
JSch.setConfig("server_host_key", JSch.getConfig("server_host_key") + ",ssh-rsa");
JSch.setConfig("PubkeyAcceptedAlgorithms", JSch.getConfig("PubkeyAcceptedAlgorithms") + ",ssh-rsa");