我正在尝试 ssh(从我的 Ubuntu 18.04 桌面)到正在运行的 EC2 实例
ssh -i /home/miki/pizda/jk/keys/kur/kjam/python-kjam.pem [email protected]
ssh: connect to host ec2-18-194-207-247.eu-central-1.compute.amazonkur.com port 22: Connection timed out
同样如果我尝试IP
ssh -i /home/miki/pizda/jk/keys/kur/kjam/python-kjam.pem [email protected]
ssh: connect to host 18.194.207.247 port 22: Connection timed out
我可以ping IP
ping 18.194.207.247
PING 18.194.207.247 (18.194.207.247) 56(84) bytes of data.
^C
--- 18.194.207.247 ping statistics ---
544 packets transmitted, 0 received, 100% packet loss, time 556011ms
您可能在实例上有一个本地防火墙
iptables
- 阻止您的 ssh 流量。您可以使用AWS Systems Manager和ssm-session访问该实例,然后运行
iptables -I INPUT -j ACCEPT
并查看您是否可以通过 SSH 访问该实例。如果它有效,您可以正确设置防火墙。希望有帮助:)