Ssh operation timed out on ec2 instance

amazon ec2amazon-vpcamazon-web-servicesssh

I am having a problem connecting with my Ubuntu 16.04 ec2 instance on aws.
I have added my public key to authorized keys file and also added my ip for ssh access on port 22 using Myip.

I am trying to connect using normal way:

ssh ubuntu@aws-instance.com

I have even rebooted my ec2 instance.

What else do I need to do to get access?

Thanks

Best Answer

Normally, to solve ssh connection issues in aws you can check the following things:

Check if your instance is up.

Allow 22 port in security group: check if the security group you have edited is assigned to instance. Also, only for test allow 0.0.0.0/0 (all ips) to 22 port.

Check if your AMI has ubuntu user, you can try with user admin too.

Check if the ip of the instance is public.

If all of this is correct, the problem probabilly will be in the pair public-private key. Look up with pair you use when you launch the instance and your default key is the rigth key.