I'm currently using JSch as the library for connecting to my remote server. In one of the scenarios, I should be able to log in to a server2, through server1. That is, I should first log in to server1, then ssh to another server (server2) and execute my command. Moreover, sometimes I should be able to connect to a server3 from server2.
So, basically, I'm looking for a way to have a multilevel ssh connection which I don't know how to handle in Java, as I cannot execute more than one command in each Exec Channel of a session.
Any insight will be appreciated.
Thanks, Reza