Hi,
Have you seen the following troubleshooting information in the EC2 User Guide? https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html
Check the section that talks specifically about "Connection timed out": https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectionTimeout
It's not clear to me whether you've successfully connected to this instance or another instance half a year ago? If you connected to this instance, have you stopped and then started your instance since you last connected to it? When you stop your instance, the public IPv4 address that Amazon EC2 automatically assigned to the instance on launch or start is lost. When you start your instance, a new public IPv4 address is assigned. Check that this IP address appears in your connection command.
I hope the above helps!
Kind regards, Marilyn
Hi,
It turned out that I mistakenly deleted the internet gateway attached to the VPC of that instance. So re-creating an internet gateway and attaching it to the VPC again solved the connection issue.
By the way, I meant that I could connect other instances a half year ago, not the one I deal with now. But they were inside the same VPC.
The provided link reminded me to refer the route of VPC, that was the cause of this issue.
Thank you for letting me know :-)
Best wishes, Ryosuke
Relevant questions
Ubuntu Serial Console Connection Vanished
asked 6 months agoUbuntu instance lost connection and crash
asked 5 months agoSSH connection to a newly created Ubuntu EC2 instance fails
Accepted Answerasked 14 days agoUbuntu 22.04 "Server refused our key" trying to connect via SSH [RESOLVED]
asked 4 days agoUnable to SSH to the ubuntu managed node using instance-id
Accepted Answerasked a month agoConnection Timeout Error while connection EC2 with Putty
asked 5 months agoUpgrade Ubuntu AMI version from 16.04 to 22.04
asked 2 months agoUnable to SSH to new instances unless its an AWS Ami
Accepted Answerasked 3 years agoUnable to access ec2 instance | SSH Connection Timed Out
asked a year agoEC2 ubuntu 18.04 fresh + apache2 install CONNECTION REFUSED
asked 2 years ago
Glad you're sorted now! :)