SSH Timeouts

You may find that after a period of inactivity your connection to a unix machine (solaris or linux) disconnects automatically. Typically this time might be something like one hour.

There are 3 possible causes for such inactivity timeouts:

  1. The automatic logout timeout for the login shell on the unix machine. If this is the case you will receive a "auto-logout" message when the timeout occurs.
  2. An ssh inactivity timeout on either the server or the client.
  3. A TCP inactivity timeout enforced by a router.

In the first case you should receive single word message "auto-logout" immediately before the logout occurs.

In both the second and third cases you may receive a message similar to:

  • Read from remote host myhost.com: Operation timed out
  • Connection to myhost.com closed.

the connection may also just seem to hang, or the connection will return you to your client machines prompt.

Shell auto-logout Solution

The solution to the first case (the automatic logout timeout for the login shell) is to unset the autologout shell variable. To do this:

  1. On the machine you are connecting to edit the file ".cshrc" in your home directory.
  2. Add the line "unset autologout".
  3. The new setting will take effect in all new connections.

SSH or TCP Timeout Solution for MacOS or Linux

If you are connecting from a MacOS, Linux, or other unix based machine the solution to both the second and third cases (ssh timeout or tcp inactivity) is the same:

  1. On the machine you are connecting from go to the ".ssh" directory in your home directory.
  2. Edit the file "config" (this file may not already exist and you may need to create it).
  3. Add the following lines:
    • ServerAliveInterval 600
    • ServerAliveCountMax 3
    • TCPKeepAlive no
  4. The new settings will take effect in all new connections.

It may be necessary to adjust the value of ServerAliveInterval to a lower number, however too low a number may actually cause additional disconnects if the the connection is only temporarily down. Do not set this number to a value less than 60 (one minute).

SSH or TCP Timeout Solution for Windows

If you experience the SSH or TCP timeout problem from a Windows SSH client please contact us as there doesn't appear to be a way to alter these settings in the Windows client and further research will be required.