Automatically Logout SSH Users after a period of inactivity

You can improve your server security by enforcing SSH timeout so users will be automatically log out after a period of inactivity.  Administrators can easily enforce the timeout on SSH clients by simply changing ClientAliveInterval value and restaring the sshd daemon for the changes to take place.
1) Edit /etc/ssh/sshd_config
2) Set ClientAliveInterval to 5 minutes (300 seconds)
ClientAliveInterval 300
ClientAliveCountMax 0
3) Restart sshd
/etc/init.d/sshd restart

Leave a Reply

Your email address will not be published. Required fields are marked *