I cannot SSH into my instance - Operation timed out. What could be the reasons why, and what can I do to resolve it? Rebooting normally takes a long time to take effect, an
AFTER 2 HOURS I FOUND THIS
Note That ssh ip 120.138.105.251/32
IS NOT aws instance IP ADDRESS
It Is not your local ip 127.0.0.1
It Is not your local ip localhost
BUT BUT BUT
Its Your public ip address of your personal Computer from which you trying to access aws instance
IF YOU WANT TO FULLY OPEN SSH TO ALL IP ADDRESS
THIS IS HOW FULLY ACCESSIBLE ENTRIES LOOK - BASIC RECOMEENDED
THIS IS WHAT I AM USING IN PRODUCTION
I had the same problem, and the solution was allowing access from anywhere to the list of inbound rules in the active security group. In the inbound dialog, enter 22 in the port range, anywhere in the source field, and select 'ssh' in the dropdown.
P.S : This might not be the recommended solution as it means this instance can be ssh'ed from any machine, but I could not get it to work with my local IP.
I was working on the instance and it was fine, the very next day when I tried to SSH into my instance it said - Connection timeout.
I tried to go through this post but nothing worked. So I did -
On the Edit inbound rules
from source column choose MY IP
and it will automatically populate your Public IP address in CIDR format (XXX.XXX.XXX.XX/32
).
I tried with the @ted.strauss answer by giving local IP but it did not help in my case. So I choose MY IP and it worked.
Hope this helps someone!
For me it was the apache server hosted on a t2.micro linux EC2 instance, not the EC2 instance itself.
I fixed it by doing:
sudo su
service httpd restart
I had similar problem, when I was using public Wifi, which didn't have password. Switching the internet connection to a secure connection did solve the problem.
ping the DNS first . If fails then configure your inbound/outbound rules in the launch wizard . configure ALL traffic and ALL protocol and just save with default options . Ping again with your local system and then should work