title: jsch session.connect() problems
body: <p>I'm new to Jsch and I'm trying to connect to a third party through sftp. I can connect over ssh so I know I have the right user, host, port and private key file, but when I try to connect through Jsch I get the exception message &quot;Auth failed&quot;, which is almost, but not quite, helpful. Here is my code that I pieced together from examples online:</p>
  <pre><code>String pvtkey = &quot;{unixpath}/id_dsa&quot;;
  ChannelSftp sftp = null;
  JSch jsch = new JSch();
  Session session = null;
  
  try {
      jsch.setKnownHosts(&quot;{unixpath}/known_hosts&quot;);
      jsch.addIdentity(pvtkey);
      session = jsch.getSession(user, connectionURL, 22);
      Properties config = new Properties();
      config.put(&quot;StrictHostKeyChecking&quot;, &quot;no&quot;);
      session.setConfig(config);
      session.connect();
      // ...some other code that never gets called
  } catch (JSchException e) {
      log.info(e.getMessage());
      log.error(e.getCause());
  }
  </code></pre>
  <p>I added some logs so I know the failure is happening as session.connect(). I've caught the user and the connectionURL and verified that they are being passed in properly. The path to the pvtkey and known_hosts is the full unix path to where I hold the key and hosts files, which I've moved to a directory that holds the script tht kicks off this process. I'm still a bit new to sftp, does my public key have to be in that same directory even if I'm not adding it to the Jsch connection? Is there some way to get more information on my failure?</p>