Friday, April 27, 2012

HowTo: Linux / UNIX Unset TMOUT ( AutoLogOut )

I've set the the TMOUT in the ~/.profile of the user account as well as in /etc/profile file on my UNIX or Linux servers. How do I unset the TMOUT variable? How to unset TMOUT temporarily under UNIX like operating systems?

UNIX or Linux login shells can be configured to automatically log users out after a period of inactivity. The TMOUT (under bash ) and autologout (under tcsh) variables defines auto logout time in seconds.

Bash Shell Unset TMOUT

You can set the TMOUT variable to 15 minutes (900 seconds) as follows:
$ export TMOUT=900
$ echo $TMOUT

To unset the variable type the following under Bash shell:
$ export TMOUT=0
$ echo $TMOUT

You can also use the unset command as follows under Bash shell:
$ unset TMOUT
You can also edit out ~/.bash_profile / ~/.profile or /etc/profile file and remove TMOUT entry. This will disable the TMOUT permanently.

TCSH Shell Unset autologout

To unset the autologout variable under the tcsh shell, type:
$ unset autologout

No comments:

Post a Comment