≡ Menu


Linux: TMOUT To Automatically Log Users Out

How do I auto Logout my shell user in Linux after certain minutes of inactivity?
[click to continue…]

Bash Configure Automatic Logout [ Linux / Unix / Apple OS X ]

How can I configure automatic logout for my bash shell under Unix / Apple OS X / Linux operating systems?\
[click to continue…]

Linux / UNIX Automatically Logout BASH / TCSH / SSH Users After a Period of Inactivity

My development and testing webserver is used by over 100s of users. These users login from Windows XP, Linux, Mac OS X system via ssh/putty client. How do I set or automatically log users out after a period of inactivity under RHEL/Fedora/CentOS Linux server to improve server security and save some resources?
[click to continue…]

Linux logged out a user automatically

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):
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.