Sunday, October 14, 2007

How to set or disable auto-logout on bash shell

Following information is intended for bash shell only.
The system variable TMOUT can be set to specify the amount of time the user is inactive before the user is automatically logged out.
Set the following listed below in the /root/.bashrc file: TMOUT=XXX #
The system will logout the root account after one hour of inactivity. The value entered for the TMOUT= variable is in seconds. To represent 1 hour, we have to multiply as follows: 1 hour is 60 minutes. 60 minutes * 60 seconds = 3600 seconds.
After setting the parameter, the intended user will need to log out and then log in for the changes to take effect. To make modifications apply to all users on the system, specify the TMOUT variable in /etc/ profile.
To disable auto-logout simply comment out or delete the line with TMOUT value

Provided by:Forthscale systems, cloud experts

1 comment:

sandipon.duet said...

To disable auto-logout, just set the TMOUT to zero or unset it as follows:

$ export TMOUT=0
or
$ unset TMOUT