Stop SSH and SFTP timeout

Filed under linux, security, and ssh.

Just add the following line to /etc/ssh_config (on the machine you’re SSHing from) :

ServerAliveInterval 60

Next time you SSH of SFTP you’ll be sending ‘keepalive’ packets every 60 seconds. No more Connection reset by peer!
If you have root access on the remote server, you can also set

ClientAliveInterval 60

in /etc/sshd_config to achieve the same effect.


If you enjoyed this post, please follow us on twitter or subscribe to our feed!