To
secure server from illegal access we can set idel timeout interval for SSH session, so that SSH session will be reset once SSH user exceed idel timeout interval period. We can define idel timeout interval time in default SSH configuration file
/etc/ssh/sshd_config.
Log in to server as root user and open file
/etc/ssh/sshd_config and make sure that following option is not commented.
ClientAliveInterval 600
ClientAliveCountMax 0
In above example idel timeout interval is set 600 seconds. After 600 seconds user will be logged out from SSH session.