Set SSH heartbeat to avoid ‘Broken pipe’

Three methods:

  1. Set on server
sudo echo "\nClientAliveInterval 60\nClientAliveCountMax 1" >> /etc/ssh/sshd_config
  1. Set on clinet
sudo echo "\nTCPKeepAlive yes\nServerAliveInterval 60" >> /etc/ssh/ssh_config
  1. Set parameters on SSH command
ssh -o TCPKeepAlive=yes -o ServerAliveInterval=60 [email protected]