EC2 SSH Connection Timed Out
Quick answer
A timeout means traffic never reaches the instance: fix the security group inbound rule for port 22, the subnet route to an internet gateway, network ACLs, or the missing public IPv4 address.
Most likely fix: Check the instance is ready
How to fix it
Try these in order — the most common fix is first.
1. Check the instance is ready
- EC2 > Instances: state must be running and status checks passed
Did this fix it?2. Fix the security group
- Select the instance > Security tab > Inbound rules
- Add a rule: SSH, TCP 22, source = your public IP (or range if your IP changes)
Did this fix it?3. Fix routing
- Instance > Networking tab, note VPC and subnet
- VPC > Subnets > Route table: need 0.0.0.0/0 to the internet gateway (::/0 for IPv6)
- Confirm an internet gateway is attached to the VPC
Did this fix it?4. Check network ACL and public IP
- VPC > Subnets > Network ACL tab: allow inbound 22 and outbound 1024-65535
- Associate an Elastic IP if the instance has no public IPv4
Did this fix it?5. Use another way in
- Try EC2 Instance Connect from the console, or Systems Manager Session Manager
- Check CloudWatch CPU in case the instance is overloaded
Did this fix it?
Symptoms
ssh hangs and ends with 'Connection timed out' or 'Network error: Connection timed out'.
Why it happens
- Security group has no inbound rule for port 22 from your IP
- Your IP changed so a single-IP rule no longer matches
- Subnet route table lacks 0.0.0.0/0 to an internet gateway
- Network ACL blocks port 22 or ephemeral return ports
- Instance has no public IPv4 address
- Corporate firewall blocks port 22
- Instance not running or failing status checks
This guide also covers
- ec2 ssh connection timed out
- aws ec2 cannot ssh
- ssh to ec2 timeout
- can't connect to ec2 instance
Still not working?
If AWS keeps failing, you're not alone. See every AWS problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other AWS errors
- AWS Unexpected Charges: Why Is My AWS Bill So High?
- AWS Charges After Free Tier: Why Am I Being Billed?
- AWS Account Suspended: How to Reactivate It
- EC2 SSH 'Permission denied (publickey)' and Key File Errors
- S3 Access Denied (403 Forbidden) Error
- AWS 'Not Authorized to Perform' IAM Error
- Lambda 'Task timed out after 3.00 seconds' Error
- CloudFront 403 Error: The Request Could Not Be Satisfied