To configure a BASH, KSH, TCSH, or ZSH shell to log out a user automatically after a certain period of idle time, you can use the TMOUT shell variable.
~/.bashrc, ~/.zshrc, etc.):TMOUT=3600
This will set the idle time to one hour (3600 seconds). You can adjust the value to your desired time.
TMOUT variable to 0:TMOUT=0
Note: The
TMOUTvariable is only supported in BASH, KSH, and TCSH. In ZSH, you can use theTMOUTvariable or theIDLE_TIMEOUTvariable, which works in the same way.