我无法从网络上的一台机器通过 SSH 连接到服务器。我可以使用网络上其他机器上完全相同的端口、地址、用户和 ssh 密钥成功进行 SSH。当我尝试连接时,一半的 MOTD 被打印出来,然后连接挂起。我认为这可能是我的终端读取 MOTD 的问题,但我尝试了几个带有 WSL bash shell 的不同终端,问题始终存在。
问题可能是什么,或者诊断的下一步是什么?
该服务器正在运行 Ubuntu 20.04.2 LTS 和 OpenSSH 8.2p1
期望
实际的
成功输出
debug1: Authentication succeeded (publickey).
Authenticated to REDACTED ([REDACTED]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_TERMINAL = iTerm2
debug1: Sending env LC_TERMINAL_VERSION = 3.3.7
_ _
___ _ ___ ___ | | ___ _ | | _____
/ | '_ \ / _ \ / _ \| |/ / | | |/ _` |/ _ \ \ / /
\__ \ |_) | (_) | (_) | <| |_| | (_| | /\ V /
|___/ ./ \___/ \___/|_|\_\\__, |\__,_|\___| \_/
|_| |___/
Last login..........: root at Sat Apr 17 18:25 from REDACTED
故障输出
debug1: Authentication succeeded (publickey).
Authenticated to REDACTED ([REDACTED]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
_ _
___ _ __ ___ ___ | | ___ _ __| | _____ __
/ __| '_ \ / _ \ / _ \| |/ / | | |/ _` |/ _ \ \ / /
\__ \ |_) | (_) | (_) | <| |_| | (_| | __/\ V /
答案1
这原来是 WSL 的一个问题。如所述这个问题,在Windows CMD中执行以下操作解决了该问题:
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns