linux shell automatic logout

July 12, 2007 at 7:07 pm | Posted in Linux, Security | Leave a comment

The Problem

Many users (including system administrators) leave their logged in Linux shell open and leave their desk. There is no lock screen option if you are running your Linux box in pure CLI mode so any sneaker can access your documents, the situation is worse if a root user leaves his session as the sneaker can poke their nose into the whole system and do whatever they want.

The Solution

Luckily there is an environment variable in BASH1 called TMOUT by using you can instruct the shell to exit (or logout) if it is idle for the given seconds. Note the shell will only exit if it is idle that is no actively running program like vi editor session. Use the following in your ~/.bash_profile file to make this permanent.

export TMOUT=300

This is will make the shell to exit automatically if left idle for 300 seconds (5 minutes) 


Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at
Entries and comments feeds.

%d bloggers like this: