AWS:"ssh: connect to host **.***.***.** port 22: Operation timed out"



虽然我的问题看起来很普通,但它似乎与stackoverflow中讨论的任何问题都不一样。SecurityGroup已经为ssh连接设置了"MyIP",我一直在使用正确的pub IP进行连接。然而,我仍然得到超时错误如下。我的Mac里有什么东西需要换吗?

MacBook-Pro ~ % ssh -vvv -i ~/Documents/awsdemo/aws-livelessons.pem ec2-user@18.181.146.195
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolve_canonicalize: hostname 18.181.146.195 is address
debug2: ssh_connect_direct
debug1: Connecting to 18.181.146.195 [18.181.146.195] port 22.
debug1: connect to address 18.181.146.195 port 22: Operation timed out
ssh: connect to host 18.181.146.195 port 22: Operation timed out

这是我的安全小组。你可以看到它确实有正确的协议,并使用我的公共IP输入。

安全组屏幕截图

当我通过终端查找时,我可以确认它确实匹配。

MacBook-Pro ~ % dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
"58.12.38.113"

并且EC2实例确实附加了此安全组。

EC2实例屏幕截图

如果有任何其他方法来解决这个问题,我真的很感激

根据评论,该问题是由于使用了非默认NACL。解决方案是允许在NACL中使用SSH。

相关内容

最新更新