Linux: TMOUT To Automatically Log Users Out

The TMOUT variable in Linux is used to automatically log out users after a specified period of time if they have been inactive. To set this variable, you can add the following line to your .bashrc file or a global shell configuration file:

TMOUT=600

The value 600 specifies the number of seconds of inactivity after which the user will be logged out. In this example, the user will be logged out after 10 minutes (600 seconds) of inactivity.

Note: This feature is specific to the bash shell, so it may not work with other shells. Also, it is important to keep in mind that automatically logging out users after a specified period of time can be seen as a security measure, but it may also be seen as a convenience feature. Choose the right value for TMOUT based on your specific needs and requirements.

Leave a Comment