Just add the following line to @/etc/[email protected] (on the machine you’re SSHing from) :
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
in @/etc/[email protected] to achieve the same effect.