PuTTY SSH Session Timing Out When Idle? Check the TMOUT Variable

If your PuTTY or SSH session to a Linux server logs you out after a period of inactivity, the shell’s TMOUT environment variable is a likely cause. It tells bash to close an idle session after a set number of seconds.

Check Whether TMOUT Is Set

env | grep TMOUT
# or
echo $TMOUT

Change or Disable the Idle Timeout

Set a longer timeout, in seconds (here, one hour):

export TMOUT=3600

Or turn the feature off for your session:

unset TMOUT

Note: your system administrator may have set TMOUT for security reasons. If you’re not the admin, check with them before changing it.