exam cram ec2
Amazon Web Services

Exam Cram: AWS EC2 – SSH Troubleshooting

Reading Time: < 1 minute

SSH bad permissions

This is typically an issue with your ssh key file or pem file. The error is a bit misleading.

Some operating systems may give a little more detail, something like:

WARNING: UNPROTECTED PRIVATE KEY FILE! 
Permissions 0644 for 'super-secure-key.pem' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: super-secure-key.pem
Permission denied (publickey).
  • make sure your ssh key file or pem file has the correct permissions
    • It should be restricted to 400
  • chmod 400
  • 400 restricts to read-only permissions
Erro: No supported authentication methods available
  • If using PuTTY – make sure your private key (.pem) file has been converted to the correct format required by PuTTY (.ppk). Use the puttygen to convert a .pem key file to a .ppk file

SSH Permission Denied

  • Check the username
    • Amazon Linux 2 AAMI: ec2-user@ip-address
    • Ubuntu AMI: ubuntu@ip-address
    • Debian AMI: admin@ip-address
    • Centos AMI: centos@ip-address

SSH Timeout

  • Wrong Machine (check the IP address)
  • Security Group does not allow port 22 traffic from your IP address
  • CPU usage is too high to allow you in

Leave a Reply

Your email address will not be published. Required fields are marked *