I need to be able to ssh from a Java program to a remote server, and from there SSH to another server. I have credentials for both servers on my client.
Commands will be automatically transmitted from the application in the form of regular strings (without user input). I need to be able to run these user commands on a second server and be able to decide which commands to execute at runtime based on the output and some simple logic.
Can I use JSch for this, and if so, where should I start learning? (Examples, information)
==================================================== ============
ADDED:
Exception in the thread "main" com.jcraft.jsch.JSchException: UnknownHostKey: host.net. RSA Key Fingerprint - "blahblahblah"
as until now, I solve this problem by modifying the known_hosts file and adding the host there manually. Can I get around this little problem with the settings somewhere, telling JSch to automatically press YES when this question is YES-NO?
source
share