title: Transferring a file to an amazon ec2 instance using scp always gives me permission denied (publickey,gssapi-with-mic)
body: <p>I am trying to transfer a file to an ec2 instance. I followed the Amazon's documentation, this is what my command looked like:</p>
  
  <pre><code>scp -i [the key's location] Documents/[the file's location] ec2-user@[public dns]:[home/[destination]]
  </code></pre>
  
  <p>where I replaced all the variables with the proper things, I am sure it's the correct key and it has permission 400. When I call the command, it tells me the RSA key fingerprint, asks me if I want to continue connecting. I type yes and it replies with </p>
  
  <pre><code>Permission denied (publickey,gssapi-with-mic)
  lost connection
  </code></pre>
  
  <p>I have looked at many of the other similar questions on stack overflow and can't find a correct way to do it.</p>
  
  <p>Also ssh traffic is enabled on port 22.</p>