Why can't I SSH into a new EC2 instance I created from an AMI I generated?

I was able to fix this, and it was two things:

  1. I had removed the ec2-user key from /root/.ssh/authorized_keys which I think was preventing the AWS process from completing the initialization process.
  2. The NFS service seemed to be hanging on boot.

When I put the ec2-user info back in, and then set NFS to not start on boot, I was able to successfully launch and log in to a new instance.


Double check in Amazon Web Services the followings settings for your instance:

  • Security Group for your instance is allowing Inbound SSH access (check: view rules).
  • For VPC instance, check its attached Route table which should have 0.0.0.0/0 as Destination and your Internet Gateway as Target.
  • Double check your route info in System Log in Networking of the instance.

For more details, check: Troubleshooting Connecting to Your Instance