You can also configure your client to keep alive the connection every n seconds with ServerAliveInterval.
Edit /etc/ssh/ssh_config or ~/.ssh/config and add
It will send a keep alive every 360 seconds. Goes under the
Host * directive so it applies to all the boxes you connect to. And that way you don’t need to edit sshd_config on all your servers.