I went through the AWS document and followed it step by step for the connection timeout. It looks like I have done everything right, but the problem still persists.
I am using a Windows instance and was wondering what is the AMI user name for it? I am trying to use ec2-user and root. But the connection times out for both making it unclear about the right username.
Also, other means to resolve the issue please.
The default username for AWS windows account should be administrator . source
My debugging steps to EC2 connection time out
Double check the security group access for port 22
Make sure you have your current IP on there and update to be sure it hasn't changed
Make sure the key pair you're attempting to use corresponds to the one attached to your EC2
Make sure your key pair on your local machine is chmod'ed correctly. I believe it's chmod 600 keypair.pem
check this
Make sure you're in either your .ssh folder on your host OR correctly referencing it: HOME/.ssh/key.pem
Last weird totally wishy washy checks: reboot instance, assign elastic IP and access that, switch the @publicIP to @publicDNS, add a :
at the end of user@ip :
, etc. Totally mystical debugging sets for 6 though. That's part of the "my code doesn't work - don't know why. My code does work - don't know why." Category
Check that port 22
is open in security group associated to your ec2 machine. SSH
protocol works on the 22
port by default. Also, check that public IP
is assigned to the machine and you are using public IP to SSH (not private IP)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.