Hey,
There's 2 suggestions, and two ways to adjust timeout. My first suggestion is to not use SSH in the first place but a tool called
MoSH. I use it myself and works great for this situation, changing IPs, high-latency connections, etc.
Now if you don't want to install anything else, you can adjust timeouts both server side and client side. Server side, in /etc/ssh/sshd_config you should make sure the following is set:
Code:
TCPKeepAlive yes
ClientAliveCountMax 99999
ClientAliveInterval 30
Client side, you should have the following set in ~/.ssh/config:
Code:
ServerAliveInterval 100
For both
ServerAliveInterval or
ClientAliveInterval, this is telling SSH how often is should poll the connection, preventing the connection from timing out.
ClientAliveCountMax is how many times to poll before considering the client dead.
I hope that helps.