title: SSHJ - Keypair login to EC2 instance
body: <p>I have a pem file that looks like the one in SSHJ tests (though I don't see it being referenced): <a href="https://github.com/shikhar/sshj/blob/master/src/test/resources/hostkey.pem" rel="noreferrer">https://github.com/shikhar/sshj/blob/master/src/test/resources/hostkey.pem</a> . Simply trying to auth in via the pem file to an EC2 instance (read as string), but having trouble.  Anyone done this?</p>
  
  <pre><code>    SSHClient ssh = new SSHClient();
      ssh.connect("ec2-XXXXXXX.compute-1.amazonaws.com");
      ssh.authPublickey("ubuntu", getPemAsString("/Users/me/ec2.pem"));
      final Session session = ssh.startSession();
      session.exec("echo -e \"test\" &gt;&gt; /home/ubuntu/testfile");
  </code></pre>
  
  <p>Error is below:</p>
  
  <pre><code>INFO [main] (TransportImpl.java:152) - Client identity string: SSH-2.0-SSHJ_0_8
  INFO [main] (TransportImpl.java:161) - Server identity string: SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1
  INFO [main] (KeyExchanger.java:195) - Sending SSH_MSG_KEXINIT
  INFO [reader] (KeyExchanger.java:357) - Received SSH_MSG_KEXINIT
  INFO [reader] (AbstractDHG.java:110) - Sending SSH_MSG_KEXDH_INIT
  INFO [reader] (KeyExchanger.java:370) - Received kex followup data
  INFO [reader] (AbstractDHG.java:120) - Received SSH_MSG_KEXDH_REPLY
  ERROR [reader] (TransportImpl.java:570) - Dying because - net.schmizz.sshj.transport.TransportException: [HOST_KEY_NOT_VERIFIABLE] Could not verify `ssh-rsa` host key with fingerprint `xx:0a:xx:b5:c2:fd:44:1d:e0:e4:fc:d8:5f:f8:dd:f6` for `ec2-XXXX.compute-1.amazonaws.com` on port 22
  INFO [reader] (TransportImpl.java:302) - Setting active service to null-service
  ERROR [main] (Promise.java:171) - &lt;&lt;kex done&gt;&gt; woke to: net.schmizz.sshj.transport.TransportException: [HOST_KEY_NOT_VERIFIABLE] Could not verify `ssh-rsa` host key with fingerprint `xx:0a:xx:b5:c2:fd:44:1d:e0:e4:fc:xx:5f:f8:dd:f6` for `ec2-XXXX.compute-1.amazonaws.com` on port 22
  </code></pre>
  
  <p>EDIT:  Still no luck. Must be doing something wrong with the private key AWS generates for login?</p>
  
  <pre><code> SSHClient ssh = new SSHClient(); 
   ssh.connect("ec2-XXX.compute-1.amazonaws.com"); 
   ssh.addHostKeyVerifier("dd:9c:XX:fa:6a:XX:32:6a:2b:c3:e7:bd:2b:15:26:5f:76:b6:‌​c4:fe"); 
   ssh.authPublickey("ubuntu", getRSAPrivateKeyAsString("mypem")); // Must be wrong?
  
   final Session session = ssh.startSession(); 
   session.exec("echo -e \"test\" &gt;&gt; /home/ubuntu/testfile");
  </code></pre>