Example Error:
cmacedo-OSX:.ssh camilamacedo$ ssh -i my_pair_key.pem IP/DNS
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Possible Situations
- You’re not specifying the correct SSH keypair file or user name in the ssh command you’re using to log into the server:
ssh -i [full path to keypair file] root@[EC2 instance hostname or IP address]
- You don’t have the correct permissions on the keypair file; you should use $ chmod 600 [keypair file]
- You forgot to use the user ‘ec2-user’ :
cmacedo-OSX:.ssh camilamacedo$ ssh -i my_pair_key.pem ec2-user@IP/DNS
**NOTE**: For you get more information add -v ( verbose ) in the ssh command.