编辑服务器 /etc/ssh/sshd_config, 1 2 ClientAliveInterval 60 ClientAliveCountMax 1 这样ssh server每60秒自动发送一个信号给client,等待client回应。