You should check the
/etc/ssh/sshd_config
file on your server, it should have the following options enabled:
TCPKeepAlive yes ClientAliveInterval 60
or when opening the connection use the following options in your ssh command:
ssh -o TCPKeepAlive=yes -o ClientAliveInterval=60
an other option is to just keep some action by running something like:
sh -c 'while echo "Still Active" ; do sleep 20 ; done'&
you could also put this in your login script so you do not need to enter this manually.