遇到packet_write_wait: Connection to port 22: Broken pipe的解决办法

时间:2025-02-20 07:17:53

遇到packet_write_wait: Connection to  port 22: Broken pipe的解决办法

解决办法一:
在客户端的~/.ssh/config文件中添加以下配置,每30秒向server发一个空包,尝试2次仍失败则放弃
ServerAliveInterval 30

ServerAliveCountMax 2

 


解决办法二:
在服务端的/etc/ssh/sshd_config文件中添加以下配置
ClientAliveInterval 30  

ClientAliveCountMax 2