It appears that your current situation is that you are unable to SSH into your Amazon EC2 Linux instance. Once you are able to do this, it is likely that everything else will be working for you.
Operating System
First, you can confirm that the instance is booting the operating system. In the Amazon EC2 management console, select the instance and then go to Actions / Instance Settings / Get System Log. If the operating system booted correctly, it should display a lot of log information, ending with a login:
prompt. If this is not appearing, then something is wrong with the contents of the boot disk and none of the following steps will apply.
Security Group
The most common cause of a "connection time out" is an incorrect configuration of the security groups.
Check the security groups associated with the instance. They should permit Inbound access on port 22 (SSH) either from your IP address or 0.0.0.0/0
. For debugging purposes, I recommend temporarily setting this to 0.0.0.0/0
just to eliminate one possible cause of the problem. Then, try to SSH again.
Network
Next, I would suggest testing the network by launching an Amazon EC2 instance in the same subnet. If this works, then we know that the network is setup correctly. The steps are:
- Launch a new Amazon EC2 Linux instance
- Choose the same subnet as the original instance
- Choose Auto-assign Public IP = Enable
- Leave everything else at the default settings and launch the instance
- You will need to select a keypair, so make sure it is one for which you have the private half of the keypair
After a few minutes, try to SSH into this new instance.
If you were able to successfully SSH into the new instance, then this indicates that the networking configuration for that subnet is fine.
Worst case
By elimination, the resulting cause of the problem would lie in the system configuration within the instance. Without being able to SSH into the instance, this would be difficult to resolve.
In such a case, it would be necessary to launch a replacement instance. If you wish to recover data from the original instance, this can be done by stopping the original instance, detaching the Amazon EBS boot disk, then attaching it to another instance so that the content can be copied off.