End SSH Sessions even when NO-OPs are being sent by clients
We are trying to find a good way to disconnect SSH sessions to our servers when users are leaving their SSH sessions connected when they go home for the day. The SSHD timeout settings (ClientAliveInterval 300, ClientAliveCountMax 0) are not disconnecting the users, as the users have set SecureCRT to "Send protocol NO-OP" every 60 seconds. Therefore the ssh server sees the session as not being idle.
Is there any way to get the SSH server to ignore the NO-OP commands, or another way to timeout/end sessions when there has been no other input from the user?
Thanks
Assuming the users have ksh/bash/zsh, you can set the TMOUT-variable, either in each users profile/rc-file, in /etc/profile or /etc/profile.d/autologout.sh
TMOUT=300
readonly TMOUT
export TMOUT
The above sets the timeout to 300 seconds. Another option is to use a cron-script with who
and log out idling sessions.
See more here.