简体   繁体   中英

SSH connect to EC2 instance of natty operation timeout

Novice has been trying to ssh into ec2 for 5 hrs straight. Could they make anymore unfriendly to newbies? Trying 4-5 different tutorials to no avail. I've saved cert and pk in .ec2 folder and keypair in .ssh folder. Too many variables here (port authorize needed?, ubuntu uni/multiverse needed?, syntax issue?). Any ideas guys?

ssh -v -v -i *****.pem ubuntu@ec2-XX-XX-XX-XX.us-west-1.compute.amazonaws.com
OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to ec2-XX-XX-XX-XX.us-west-1.compute.amazonaws.com [XX.XX.XX.XX] port 22.
debug1: connect to address XX-XX-XX-XX port 22: Operation timed out
ssh: connect to host ec2-XX-XX-XX-XX.us-west-1.compute.amazonaws.com port 22: Operation timed out

do you have the port opened in your security group ? - if not allow port 22 for the ip's from where you want to connect.

As Paul says, the default security group blocks ssh. You can enable it under "Security & Groups".

为安全组启用SSH

Also, this information is listed in the Amazon documentation at http://docs.amazonwebservices.com/AmazonEC2/gsg/2006-06-26/running-an-instance.html

As deanpcmad said:

If you have setup an elastic IP, you need to connect via SSH to that new IP, not the public DNS.

So connect to:

ssh -i ~/.ec2/***.pem -v ubuntu@YOUR_ELASTIC_IP

I had the same problem and The Dean Perry's answer worked for me. If you setup an elastic IP, you need to connect via SSH to that new IP, not the public DNS.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM