title: Connecting AWS EC2 instance asks for password although PEM file is provided
body: <p>I've just created an EC2 instance on AWS. Before that, I created my key pair, downloaded the private key.</p>
  
  <p>I'm now trying to log on to the newly created instance (using correct host name, of course, what I replaced here for security). I've added -v switch to get the debug output:</p>
  
  <pre><code>ssh ec2-user@myVirtualHost.compute-1.amazonaws.com -i ~/EC2key.pem -v
  </code></pre>
  
  <p>Though I provide the key file, I am asked for password. Here's an excerpt from the debug output that might show what's going wrong:</p>
  
  <pre><code>debug1: Host 'myVirtualHost.compute-1.amazonaws.com' is known and matches the ECDSA host key.
  debug1: Found key in /home/myuser/.ssh/known_hosts:15
  debug1: ssh_ecdsa_verify: signature correct
  debug1: SSH2_MSG_NEWKEYS sent
  debug1: expecting SSH2_MSG_NEWKEYS
  debug1: SSH2_MSG_NEWKEYS received
  debug1: Roaming not allowed by server
  debug1: SSH2_MSG_SERVICE_REQUEST sent
  debug1: SSH2_MSG_SERVICE_ACCEPT received
  debug1: Authentications that can continue: publickey,password
  debug1: Next authentication method: publickey
  debug1: Trying private key: /home/myuser/EC2key.pem
  debug1: read PEM private key done: type RSA
  debug1: Authentications that can continue: publickey,password
  debug1: Next authentication method: password
  ec2-user@myVirtualHost.compute-1.amazonaws.com's password:[asks for password here]
  </code></pre>
  
  <p>Why after "read PEM private key done: type RSA" the conclusion is "Authentications that can continue: publickey,password"?</p>