Add this to your /etc/defaults/etc/ssh_config file to prevent SSH servers from disconnecting you after inactivity:
ServerAliveInterval 60