我们设置了 2 台计算服务器,我可以通过 SSH 顺利连接到每台服务器。
从 Windows:
PS C:\Users\MyUser> ssh user@server1 -vvv
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data C:\\Users\\MyUser/.ssh/config
debug1: C:\\Users\\MyUser/.ssh/config line 5: Applying options for server1
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolving "server1" port 22
debug2: ssh_connect_direct
debug1: Connecting to server1 [10.68.18.78] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\MyUser/.ssh/id_rsa type 0
然后再进行一些操作,连接就成功了。
当我想从其他计算服务器连接到该服务器时,我得到的却是:
(base) user@server2:~$ ssh roth@server1 -vvv
OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolving "server1" port 22
debug2: ssh_connect_direct
debug1: Connecting to server1 [10.68.18.78] port 22.
^C
它在连接到 server1 时无限期挂起,直到我取消 ssh 连接。我尝试禁用两个系统上的防火墙,但这没有帮助,现在我不知道该如何解决这个问题。
系统是ubuntu20.04(server2)和ubuntu18.04(server1)。
如果我想从 server1 连接到 server2,那就可以了。