Linux SSH 连接到 ec2 连接超时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20739377/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 01:41:55  来源:igfitidea点击:

SSH connection to ec2 Connection timed out

linuxubuntuamazon-web-servicessshamazon-ec2

提问by bobbarav

I cannot SSH in to my ec2 instance from ubuntu 12.11.

我无法从 ubuntu 12.11 SSH 连接到我的 ec2 实例。

I tried all the methods of ssh by giving key as credentials

我通过将密钥作为凭据尝试了 ssh 的所有方法

I used

我用了

ssh -v -i ~/.ec2/pes.pem [email protected]

and I am getting the output as

我得到的输出为

OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to ec2-54-209-148-122.compute-1.amazonaws.com [54.209.148.122] port 22.

debug1: connect to address 54.209.148.122 port 22: Connection timed out
ssh: connect to host ec2-54-209-148-122.compute-1.amazonaws.com port 22: Connection timed out

Thank u,

感谢你,

回答by kenshinji

Please make sure that you have configured it on security group for port 22, you can refer it from the following link: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html

请确保您已在端口 22 的安全组上配置它,您可以从以下链接中引用它:http: //docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-实例.html

回答by Barak

Check for a firewall blocking access to this port or IP. It might be a firewall running on the client machine, the server machine or a network firewall running in the client network.

检查防火墙是否阻止访问此端口或 IP。它可能是在客户端机器上运行的防火墙、服务器机器或在客户端网络中运行的网络防火墙。