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

ww‮‬w.lautturi.com
Bash Configure Automatic Logout [ Linux / Unix / Apple OS X ]

To configure automatic logout in Bash on Linux, Unix, or macOS, you can use the TMOUT variable. This variable specifies the number of seconds that the shell should wait for input before automatically logging out the current user. By setting the TMOUT variable, you can enable automatic logout in Bash, which can help to prevent unauthorized access to your system.

To configure automatic logout in Bash, you can use the export command to set the TMOUT variable. For example, to set the TMOUT variable to 600 seconds (10 minutes), you can use the following command:

export TMOUT=600

This will set the TMOUT variable to 600 seconds, and Bash will automatically log out the current user if no input is received within that time.

To make the changes to the TMOUT variable persistent across terminal sessions, you can add the export command to your shell's configuration file. The location and name of the configuration file depends on the shell that you are using. For example, if you are using the Bash shell, you can add the export command to the ~/.bashrc file.

By using the TMOUT variable and the export command, you can easily configure automatic logout in Bash on Linux, Unix, or macOS. This can help to prevent unauthorized access to your system and improve its security.

Created Time:2017-10-16 14:38:38  Author:lautturi