Saturday, November 10, 2007

Auto Logout of Inactive Users

How to force automatic logouts of users who forget to log out in case of inactivity detected ?

BASH have a TMOUT variable.We can set the TIMEOUT value here for sessions.


Add the TMOUT variable to your /etc/bashrc file:
# vi /etc/bashrc

Set TMOUT to 300 seconds (5 minuets):
TMOUT=300

This will automatically logout users after 300 seconds of inactivity.
This hack will only work with run level 2, 3 .It will not work with GUI sessions.

No comments: