SSH Session Inactivity Configuration?

Solution 1:

I'm using export TMOUT=3600 in my ~/.bashrc to close an inactive session after 1 hour.

Solution 2:

Most of what you are setting look tcp settings. You need to tell your shell to log you out. The comment about setting TMOUT=3600 for an hour is one that I have scored up. You may want to put this in the global profile (/etc/profile)

tcp keepalives are all to do with how often packets are sent to keep a tcp session active. eg if there was not traffic for a minute and the tcp keep alive was set to 60 seconds then a keep alive packet would be sent to keep the session active. This is a reasonable set of descriptions of the various tcp variables

Solution 3:

I've got ClientAliveInterval 600 ClientAliveCountMax 0 and it works