ssh packet_write_wait Broken pipe

ssh连接空闲一段时间后出现:

1
packet_write_wait: Connection to UNKNOWN port 65535: Broken pipe

这是连接超时,需要设置一个保持心跳的参数,客户端是ServerAliveInterval,服务器端是ClientAliveInterval,参数值单位为second,还可以在.ssh/config中为每用户、每连接设置此参数

客户端:
/etc/ssh/ssh_config文件

1
2
Host *
ServerAliveInterval 45

References:
[1]How to prevent “Write Failed: broken pipe” on SSH connection?
[2]当SSH遇到“Write failed: Broken pipe”