title: Ingesting data from remote SFTP server using JSch with public/private key authentication. Any examples?
body: <p>I am using JSch library to create and manage "secure FTP" connection in Scala. Can someone show example using public/private key in configuration of <code>session</code>?</p>
  
  <p>Right now I'm doing this</p>
  
  <pre><code>session.setConfig("StrictHostKeyChecking", "no")
  </code></pre>
  
  <p>This exposes the secure connection for unauthorized hits over maintained session which, obviously, I don't want for security reasons.</p>
  
  <p>How can I set private/public key mechanism in my code here.</p>