I've been having problems with my GNOME terminal hanging when on an extended SSH connection. Finally realized today there's probably a keepalive configuration somewhere.
Go into your ~/.ssh/config file and add this stanza under your Host config:
(note the two spaces to make it a sub-property of Host)
If you want every SSH connection to stay alive, add the rule for every host
- Why isn't this the default?
Really? You're using a Linux environment and you're asking why the default isn't "Don't just break?"