How to disconnect inactive ssh sessions ?
Hi,
I want inactive ssh sessions to get disconnected after 5 minutes. I have configured following in sshd_config ClientAliveInterval 100 ClientAliveCountMax 3 TCPKeepAlive no But, the inactive session is not getting disconnected. Would appreciate help. Thx fs |
Did you restart sshd after making changes to the sshd_config?
An alternate way to do what you want if your users use ksh or bash is to use the the TMOUT option. Assign a number to that variable and the shell session is ended after that many seconds of inactivity. Set it in /etc/bashrc or suitable equivalent (/etc/bash.bashrc on SuSE systems and read the comments at the top.) To only set the variable in shell sessions resulting from ssh logins wrap the declaration in a conditional statement based upon where they logged in from using output of 'who' or something. |
Thanks. I have restarted sshd. I will try time out option in profile.
|
Hi,
I have tried TMOUT in profile. This works only if the user is in the shell. It didn't work if user is viewing file thru 'vi'. fs |
All times are GMT -5. The time now is 01:09 AM. |