AWS EC2:ssh:连接对主机10.0.0.206口22:连接时

0

的问题

操作系统:Ubuntu

公共IP从我尝试ssh:153.5.57.2

安全规则:

入境:

Name
    Security group rule ID
    IP version
    Type
    Protocol
    Port range
    Source
    Description
    –   sgr-01a63df5e26bc8e9a   IPv4    HTTP    TCP 80  0.0.0.0/0   –
    –   sgr-0cafa26a9ca34ccbe   IPv4    SSH TCP 22  153.5.57.2/32   –
    –   sgr-047038a9c030dd52b   IPv4    HTTPS   TCP 443 0.0.0.0/0   –

出:

Name
    Security group rule ID
    IP version
    Type
    Protocol
    Port range
    Destination
    Description
    –   sgr-0812dc9c3b21745e1   IPv4    All traffic All All 0.0.0.0/0   –

ACL的规则:(入境和出境)

Rule number
    Type
    Protocol
    Port range
    Source
    Allow/Deny

22  SSH (22)    TCP (6) 22  153.5.57.2/32 Allow

100 All traffic All All 0.0.0.0/0 Allow

\*  All traffic All All 0.0.0.0/0 Deny

路线表:

Destination
    Target
    Status
    Propagated

10.0.0.0/24 local Active    No

因特网网关 是连接到我的 VPC.

子网 是连接到我的 VPC.

路线表 是与 子网.

ACL的规则 是相关的 子网.

ssh -vvv -i "my-private-key.pem" [email protected]
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 10.0.0.206 is address
debug2: ssh_connect_direct
debug1: Connecting to 10.0.0.206 [10.0.0.206] port 22.
debug1: connect to address 10.0.0.206 port 22: Connection timed out
ssh: connect to host 10.0.0.206 port 22: Connection timed out
amazon-ec2 amazon-web-services ssh
2021-11-23 10:41:22
1

最好的答案

1

你的保安团是允许接入自:

SSH TCP 22  153.5.57.2/32

因此,它的出现,你想要连接 的计算机互联网上 的亚马逊EC2实例。

然而,该命令你用来连接是:

ssh -vvv -i "my-private-key.pem" [email protected]

IP地址 10.0.0.206私人的IP地址 ,是 仅可在其中. 它是 可从互联网上。

访问EC2实例,从互联网上:

  • 实例要求一个 公共的IP地址
  • 实例,需要在一个 公共网 (定义为一个网,有一个路线表进入一个互联网网关)
  • 需要指定公共IP地址时连接的实例
2021-11-23 21:20:07

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................