Have you ever left your SSH connection idle for a few minutes and come back to a message like this?
root@none:~ # Read from remote host 69.91.127.167: Connection reset by peer
Connection to 69.91.127.167 closed.
Here is my attempt to fix this (On Ubuntu client and server):
On the server computer:
Set your ClientAliveInterval to a low value like 100
First back up your file:
root@none:/etc/ssh # sudo cp sshd_config sshd_config.backup
Then go into the /etc/ssh/sshd_config file with your editor of choice and add the line:
ClientAliveInterval 100
if it’s not there. Or edit that line if it’s already there.
Save the file, and restart your SSH server:
root@none:/etc/ssh # sudo /etc/init.d/ssh restart
Then close the session.
On your local (client) computer:
Set your ServerAliveInterval to 100 also.
Make a backup:
sudo cp /etc/ssh/ssh_config /ssh_config.backup
Then go into the /etc/ssh/ssh_config file with your editor of choice and add the line:
ServerAliveInterval 100
if it’s not there. Or edit that line if it’s already there.
And restart your session to server.