title: com.jcraft.jsch.JSchException: UnknownHostKey
body: <p>I'm trying to use <a href="http://www.jcraft.com/jsch/" rel="nofollow noreferrer">Jsch</a> to establish an SSH connection in Java. My code produces the following exception:</p>
  <pre><code>com.jcraft.jsch.JSchException: UnknownHostKey: mywebsite.example.
  RSA key fingerprint is 22:fb:ee:fe:18:cd:aa:9a:9c:78:89:9f:b4:78:75:b4
  </code></pre>
  <p>I cannot find how to verify the host key in the Jsch documentation. I have included my code below.</p>
  <pre><code>import com.jcraft.jsch.JSch;
  import com.jcraft.jsch.Session;
  
  public class ssh {
      public static void main(String[] arg) {
  
          try {
              JSch jsch = new JSch();
  
              //create SSH connection
              String host = &quot;mywebsite.example&quot;;
              String user = &quot;username&quot;;
              String password = &quot;123456&quot;;
  
              Session session = jsch.getSession(user, host, 22);
              session.setPassword(password);
              session.connect();
  
          } catch(Exception e) {
              System.out.println(e);
          }
      }
  }
  </code></pre>