From : http://www.cyberciti.biz/faq/automatically-log-out-linux-bash-user/
Q . We have a few users who frequently forget to log out and I'd like to force them or automatically log out a user in case of inactivity detected. How do I force user to be logged out automatically?
A. BASH provides TMOUT variable. It is necessary for security reasons to have an inactive user logged out after a period of inactivity from Linux / UNIX ssh / telnet session. This can be accomplished by setting an environment variable TMOUT.
Automatically log out a user
Add the TMOUT variable to your /etc/bashrc file:
# vi /etc/bashrc
Set TMOUT to 300 seconds (5 minuets):
TMOUT=300
Save an close the file. Above config would automatically logout users
after 300 seconds of inactivity. Please note that this hack only works
with run level 2, 3 i.e. it will not work with GUI sessions.
本文介绍如何通过设置TMOUT变量实现Linux系统中自动登出长时间不活跃的用户。此方法适用于通过SSH或telnet登录的用户,在提高安全性的同时减少资源浪费。

被折叠的 条评论
为什么被折叠?



