ssh_config 主机未连接,否则连接,为什么?

ssh_config 主机未连接,否则连接,为什么?

这是我的 ssh 配置:

Host example.com
    HostName [IP]
    Port 2216
    User centos
Host example-two.com
    HostName [IP]
    Port 2216
    User centos    

但是当尝试 ssh example-two.com 时超时:

OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\{{user}}/.ssh/config
debug1: C:\\Users\\{{user}}/.ssh/config line 6: Applying options for example-two.com
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname [IP] is address
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to [IP] port 2216.
debug3: finish_connect - ERROR: async io completed with error: 10060, io:0000020694DA5A60
debug1: connect to address [IP] port 2216: Connection timed out
ssh: connect to host [IP] port 2216: Connection timed out

但是这样做:

ssh user@ip -p 2216

运行顺畅。我以为 Host 是一个标签,HostName 才是最重要的,但不管怎样,example-two.com 没有指向任何地方,这是我能看出的唯一明显区别。

相关内容