- Newest
- Most votes
- Most comments
I understand you're having trouble connecting to your EC2 instance via SSH (port 22) using PuTTY, despite having verified your settings and confirmed your PC can connect to Google Cloud Platform instances. Let me help you troubleshoot this issue.
Here are several potential causes and solutions to check:
- Security Group Configuration:
- Verify that your security group has an inbound rule allowing SSH (port 22) traffic from your IP address or temporarily from anywhere (0.0.0.0/0) for testing purposes.
- Network Configuration:
- Ensure your EC2 instance is in a public subnet with a route to an Internet Gateway.
- Check that your VPC's Network ACLs are not blocking incoming SSH traffic (these are stateless and require both inbound and outbound rules).
- Verify that your subnet's route table includes a route to the Internet Gateway for 0.0.0.0/0.
- Instance Configuration:
- Confirm your instance has a public IP address assigned.
- Verify the instance is in a "running" state and has passed all status checks.
- Check that the SSH service (sshd) is running on the instance.
- Key Pair and Authentication:
- Ensure you're using the correct .ppk file that corresponds to the key pair associated with the instance.
- Verify the permissions on your key file are correct.
If you've checked all these items and are still unable to connect, try these additional troubleshooting steps:
- Try connecting using EC2 Instance Connect through the AWS Management Console as an alternative.
- Use AWS Systems Manager Session Manager if it's configured on your instance.
- Check if there are any OS-level firewall rules on the instance blocking incoming connections.
- Try rebooting your instance.
As a last resort, some users have reported success with a temporary workaround:
- Modify your security group to allow "All TCP" traffic from anywhere (0.0.0.0/0)
- Connect via SSH
- Once connected, revert back to just allowing SSH traffic
Remember to tighten your security group rules after successfully connecting for security best practices.
Sources
Port 22: Connection Time Out Issue | AWS re:Post
SSH not working on fresh account, | AWS re:Post
Unable to ssh to an instance in AWS | AWS re:Post
Unable to SSH into AWS EC2 Instance – Connection Timed Out & Forgot Credentials | AWS re:Post
Region: northeast-2 Instance Type: t3.micro Public IP assigned OS: Ubuntu 24.04 LTS I am able to connect to other Cloud platform service through putty SSH 22 port.
Security Group, VPC and to all the network properly configured. Last month, It was working properly. No configuration changed since last year. 443, 80 port working but not 22 port. Suddenly other EC2 22 port also not working. Please help. Isn't there any phone number or email I can contact to get help?
It looks like the Security Group might not allow inbound SSH (port 22) from your IP. Please check that your EC2 instance’s security group has an inbound rule: Type: SSH Port: 22 Source: your current IP or 0.0.0.0/0 (for testing).
Also confirm the instance is in a public subnet with a public IP and that you’re using the correct key pair.
Relevant content
- asked 2 years ago
- asked a year ago
- asked 6 years ago
- asked 4 years ago

Thank you for your fast help. But I tried all those. But I am still having problem.