2017-08-31 107 views
0

尝试ssh来了解AWS服务设置我自己的VPC与IPV4/V6。 子网和安全组的设置太(HTTP/S + SSH对V4开/ V6)AWS EC2甚至不能用端口22开启

当我尝试ssh -vvv -i myKey.pem [email protected]

我:

OpenSSH_7.4p1, LibreSSL 2.5.0 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 20: Applying options for * 
debug2: resolving "ec2-35-157-94-119.eu-central-1.compute.amazonaws.com" port 22 
debug2: ssh_connect_direct: needpriv 0 
debug1: Connecting to ec2-35-157-94-119.eu-central-1.compute.amazonaws.com [35.157.94.119] port 22. 
debug1: connect to address 35.157.94.119 port 22: Operation timed out 
ssh: connect to host ec2-35-157-94-119.eu-central-1.compute.amazonaws.com port 22: Operation timed out 

如果尝试aws ec2 describe-instances --instance-ids i-09e2830xxxxxx或与仪表板我可以看到我的实例并用Private and Public IPv4/v6存在,并且Public DNS

任何想法,为什么跑?

+0

您是否在安全组中打开了端口22? –

+0

是=> SSH TCP 22 0.0.0.0/0 – Ragnar

回答

1

确保你做了以下内容:

  1. 创建IGW(互联网网关),并与您的VPC相关联;

  2. 添加路线0.0.0.0/0要经过IGW;

  3. 将子网(您启动EC2的子网)与正确的路由表(包含0.0.0.0/0 -> IGW的子网)关联起来;

+0

我已经做图1和2已经。我只是添加子网。但不能连接通过SSH。 我的表路线说:10.10.0.0/16 - >本地 – Ragnar

+1

该死的我想念你的观点3 ... 0.0.0.0/0 - > IGW ...我的坏。 它的工作吧! – Ragnar