简体   繁体   English

SSH连接到nat操作超时的EC2实例

[英]SSH connect to EC2 instance of natty operation timeout

Novice has been trying to ssh into ec2 for 5 hrs straight. 新手一直试图直接进入ec2 5小时。 Could they make anymore unfriendly to newbies? 难道他们对新手不友好吗? Trying 4-5 different tutorials to no avail. 尝试4-5种不同的教程无济于事。 I've saved cert and pk in .ec2 folder and keypair in .ssh folder. 我已将.sc2文件夹和密钥对中的cert和pk保存在.ssh文件夹中。 Too many variables here (port authorize needed?, ubuntu uni/multiverse needed?, syntax issue?). 这里的变量太多(端口授权需要?,ubuntu uni / multiverse需要?,语法问题?)。 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. - 如果不允许端口22用于您想要连接的IP。

As Paul says, the default security group blocks ssh. 正如Paul所说,默认安全组会阻止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 此外,此信息在亚马逊文档中列出, 网址http://docs.amazonwebservices.com/AmazonEC2/gsg/2006-06-26/running-an-instance.html

As deanpcmad said: 正如deanpcmad所说:

If you have setup an elastic IP, you need to connect via SSH to that new IP, not the public DNS. 如果您已设置弹性IP,则需要通过SSH连接到新IP,而不是公共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. 我有同样的问题,Dean Perry的回答对我有用。 If you setup an elastic IP, you need to connect via SSH to that new IP, not the public DNS. 如果您设置了弹性IP,则需要通过SSH连接到新IP,而不是公共DNS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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