原 Linux下可以ping通但是ssh报错Connection timed out
现象
进行debug:
1 2 3 4 5 6 7 8 9 10 | debug1: /etc/ssh/ssh_config line 64: include /etc/ssh/ssh_config.d/*.conf matched no files debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/root/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/root/.ssh/known_hosts2' debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug3: ssh_connect_direct: entering debug1: Connecting to 10.52.31.6 [10.52.31.6] port 22. debug3: set_sock_tos: set socket 3 IP_TOS 0x48 debug1: connect to address 100.52.31.6 port 22: Connection timed out ssh: connect to host 100.52.31.6 port 22: Connection timed out |
原因
网络层禁用了22端口。
解决
使用2222端口替换22端口。