The Solaris machine we do most of our development on has an annoying habit of timing out SSH sessions. Doesn't matter whether the client is my Ubuntu desktop, my Solaris desktop or my Windows desktop (putty); the common factor is the big Solaris machine.
Is there anything I can do to stop this happening? It's annoying when you take a lunch break and the terminal sessions you've got open and delicately configured are all frozen so you need to kill them all and reestablish all of your context.
Yes. Configure SSH to send keepalive packets.
I've found that the keepalive behaviour didn't quite work. I tried adding the ServerAliveInterval to the ~/.ssh/config script but it doesn't play nice with git.
What I've ended up doing is adding a timestamp to my 'screen' status bar. This is enough activity to keep the connection up.
You can configure Putty to send keep alive packets too.
In Settings, Connection, Seconds between keepalives.
First, you need to determine if it's your shell which is logging you out or ssh. To test, ssh into your remote machine, and vi or less a file.
If a long time later you can still move around less/vi, then ssh is fine. In this case, determine what shell you are using, and disable the timeout. It's most likely the shell which is timing you out and not SSH. However, some firewalls will close idle sessions if keep alives aren't sent.
The Solaris administrator may prevent you from disabling the timeout in your shell, by making the setting read-only. This is unlikely, but possible. You can usually get around this by using a different shell.
If you have trouble re-configuring your shell again, you could use GNU screen. If your SSH session times out, just login again and reconnect and your shell will be just as it was.
If you run tcsh on the Solaris machine the autologout variable could be set. If you set that to 0 (set autologout=0) or unset it (unset autologout) it will stop log you out.
This may be a red herring, but try
at your shell prompt. This has certainly worked for me in the past, but I can't remember if it's restricted to certain architectures (or shells).
Type in your shell profile
You could run
top
in another terminal? That should generate regular traffic?Spinner sounds like the perfect solution to your problem. It periodically sends characters in your session to keep it from timing out.