Jun 19, 2021

EC2 - Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

  • EC2 login Issue
    • ssh -i /root/stage.pem root@ec2-54-<>.compute-1.amazonaws.com
  • ERROR
    • EC2 - Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
  • Reason
    • There is a chance PEM file not added to ~/.ssh/authorized_keys 
Solution
  • Go to EC2 Dashbaord
  • Click on Connect (EC2 Instance Connect)



  • Open ~/.ssh/authorized_keys
  • Add the entry
    • ssh-rsa AAAAB3NzaC1yc2EAAAA<....>nJXw== Staging
  • Try to SSH again
  • Done

No comments:

Post a Comment