在 Linux 下使用 SecureCRT 经常掉线,通常不是 SecureCRT 本身的问题,而是网络、系统或 SSH 配置导致的。下面按最常见原因 → 解决办法给你梳理一下。
Connection closed by remote hostSecureCRT 里开启心跳包:
Connection → SSH2Send protocol NO-OPSend keep-alive every XX seconds即使 SecureCRT 设置了 keepalive,如果服务器禁止,也会掉。
grep -E "ClientAlive|TCPKeepAlive" /etc/ssh/sshd_config
TCPKeepAlive yes
ClientAliveInterval 30
ClientAliveCountMax 3
然后重启:
systemctl restart sshd
mosh(比 SSH 更抗断)sudo apt install mosh
mosh user@host
某些 Linux 发行版:
firewalldconntrack 表超时短cat /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established
如果是 300 秒以下,可能太短。
你可以按这个顺序排查:
如果你愿意,可以告诉我:
我可以直接给你一套针对性配置。