Monday, 1 April 2013

How to set an idle timeout interval for SSH users

User can login to server via ssh and you can set an idel timeout interval to avoid unattended ssh session.
We need to edit ssh configuration file "/etc/ssh/sshd_config"


[root@mani-sys ~]# vim /etc/ssh/sshd_config 

ClientAliveInterval 300                             ### line 120
ClientAliveCountMax 0

Save and exit the file.

You are setting an idle timeout interval in seconds (300 secs = 5 minutes).After this interval has passed, the idle user will be automatically logged out.


Now restart the ssh service

[root@mani-sys ~]# /etc/init.d/sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
[root@mani-sys ~]# 

I hope this helps....

No comments:

Post a Comment