title: How to SSH to a server behind another SSH server using JSch?
body: <p>I need to be able to ssh from a Java program into a remote server, and from there SSH to another server. I have credentials for both servers on my client.</p>
  
  <p>The commands will be passed automatically from within the app as regular strings (no user input). I need to be able to run those custom commands on the second server and be able to decide what commands to issue during runtime, based on the output and some simple logic.</p>
  
  <p>Can I use JSch to do that and if yes,  where should I start look into? (Examples, info)</p>
  
  <p>=============================================================</p>
  
  <p>ADDED:</p>
  
  <blockquote>
    <p>Exception in thread "main" com.jcraft.jsch.JSchException:
    UnknownHostKey: host.net. RSA key fingerprint is 'blahblahblah'</p>
  </blockquote>
  
  <p>as till now, I am solving this problem by modifying the known_hosts file and adding host manually in there.
  Can I bypass this little problem by settings an option somewhere telling the JSch to press YES automatically when this YES-NO question is asked? </p>