我有一台家庭服务器,我可以通过笔记本电脑通过 SSH 连接到它。我遇到了一个问题:
- 我通过 SSH 进入服务器,一切正常
- 无论出于什么原因,我都会让笔记本电脑进入睡眠状态
- 唤醒后,SSH 连接已断开。当我尝试重新连接到服务器时,SSH 连接会挂起,直到超时
我已经确认 SSH 请求没有到达服务器,但我不确定问题出在我的笔记本电脑还是路由器上。我思考这是路由器,因为我可以通过重新启动路由器来解决挂起问题,但我不确定。
对于调试这个问题有什么建议吗?
SSH 连接失败打印输出:
OpenSSH_8.6p1, LibreSSL 2.8.3
debug1: Reading configuration data /Users/username/.ssh/config
debug1: /Users/username/.ssh/config line 6: Applying options for 10.0.0.239
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname 10.0.0.239 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/username/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/username/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: ssh_connect_direct: entering
debug1: Connecting to 10.0.0.239 [10.0.0.239] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: connect to address 10.0.0.239 port 22: Operation timed out
ssh: connect to host 10.0.0.239 port 22: Operation timed out
额外细节:如果您查找挂起的 SSH 连接set_sock_tos
,您会发现建议添加-o IPQoS=none
到 SSH 请求中。我试过这个,但并没有解决问题。