Recently I’ve experienced some odd SSH behavior, my connection is lost after not issuing a command for a while. Usually I get this message:
ME@SERVER:~% Read from remote host SERVER: Connection reset by peer
Connection to SERVER closed.
Nice, indeed. However, this can be fixed by creating the file ~/.ssh/config and pasting this into it:
What happens here is that you overwrite the default SSH configuration usually found in /etc/ssh/ssh_config with a different behavior. A timeout interval is set after which your SSH client will request a response from the server. This is usually done via TCP keep-alive, which is unreliable (and insecure) and therefore turned off. So, no more timed-out connections here, great! Feel free to read the ssh_config manpage for more insight.