Configuring shell auto logout features
This document (7007128) is provided subject to the disclaimer at the end of this document.
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Desktop 11
SUSE Linux Enterprise Desktop 10
test@linux:~> echo $SHELL
test@linux:~> export TMOUT=30
test@linux:~> timed out waiting for input: auto-logout
In this example the user "tux" switched to the account of the user "test" by using su -. After 30 seconds of inactivity the user gets logged out.
Using the TMOUT variable access to remote hosts can be closed as well:
Last login: Mon Nov 1 14:02:13 2010 from linux1.testenv.site
linux2:~ # timed out waiting for input: auto-logout
Connection to 192.168.66.10 closed.
On ksh a warning is issued after reaching the seconds specified by TMOUT, 60 seconds after this warning the shell exits.
Bash and ksh settings are read from /etc/profile, /etc/profile.local, $HOME/.profile, $HOME/.bashrc and $HOME/.kshrc. As /etc/profile may get updated by YaST2 Online Update, its recommended to place own changes into /etc/profile.local.
Note: The TMOUT option applies to the active shell only. In case a user switches from one shell to another, like having /bin/bash as login shell and then start /bin/ksh, the timeout will first close the ksh. It needs another full cycle to close the remaining shell. Same applies to ssh connections.
The variable for csh (/bin/csh) is called autologout and specifies minutes of inactivity. By default this feature only applies to environments where no X is running, see man csh for details.
To temporarily disable the environment variable use the command "unset" which is available for the mentioned shells. As this command may get issued by any user to unset the TMOUT value it should not be considered to increase the security of the system.
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7007128
- Creation Date: 01-Nov-2010
- Modified Date:13-Mar-2021
- SUSE Linux Enterprise Desktop
- SUSE Linux Enterprise Real Time
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: firstname.lastname@example.org