Wiki‎ > ‎

Putty ssh session timeout

posted Jun 28, 2015, 3:26 PM by Dong Xu   [ updated Jun 28, 2015, 3:27 PM ]
Client side:

putty settings -> Connection and set the value of "Seconds between keepalives" to 30
For ssh commandline:

ssh -o TCPKeepAlive=yes

Server side:

vi /etc/ssh/sshd_config

ClientAliveInterval 30
TCPKeepAlive yes 
ClientAliveCountMax 99999

Setting the environment variable TMOUT.

To check this you can just do:

env | grep TMOUT


echo $TMOUT

If it is set, you could change it or unset it. To change the value:

export TMOUT=36000

Where the number is the number of seconds until you get logged out. Otherwise unset it to turn off the feature:

unset TMOUT