How to disable SSH timeout
Inactiveor idle SSH connections are normally disconnected by the server after a certainperiod of time. This depends on how the SSH server is configured, and upondisconnection the SSH client will be prompted with a message similar to thefollowing;
Read from remote host oseems.com:Connection reset by peer
Connection to oseems.com closed.
Thiscould be avoided by changing the SSH server's configuration, or tricking theserver from the client's end.
SSHClient
This is probably the easiest method as it doesn'trequirerootor administrator access tothe server and it could be applied to all SSH connections instead of just to aspecific server.
What's going to happen is to basically keep theconnection active even if the user is actually idle. This could be done byusing theServerAliveIntervaloption where the SSH clientwill send a null packet to the server over a set period of time just to keepthe connection alive.
Thefollowing option will send the packet every 100 seconds;
ServerAliveInterval 100
In Linux this could be set globally in/etc/ssh/ssh_configor per-user in~/.ssh/config. It could also be used inthe command line as an argument as in the following example;
ssh -o [email protected]
SSHserver
Withadministrator / root access, the option could just be disabled in the server.Set the related options in the global SSHd configuration file as the following,and restart the SSHd service.
ClientAliveInterval 30
TCPKeepAlive yes
ClientAliveCountMax 99999
In Linux,/etc/ssh/sshd_confignormally is theconfiguration file and the service could usually be restarted by the followingcommand;
sudo service sshd restart