Configuring automatic logouts and security banners
Best security practice dictates that people log out of their computers before they walk away from their desks. This is especially important when an administrator uses his or her cubicle computer to remotely log in to a sensitive server. By default, SSH allows a person to remain logged in forever without complaining. However, you can set it up to automatically log out idle users. We’ll look at two quick methods for doing that.
Configuring automatic logout for both local and remote users
This first method will automatically log out idle users who are logged in either at the local console or remotely via SSH. Go into the /etc/profile.d/
directory and create the autologout.sh
file with the following contents:
TMOUT=100
readonly TMOUT
export TMOUT
This sets a timeout value of 100
seconds. (TMOUT
is a Linux environmental variable that sets timeout values.)
Set the executable permission for everybody:
sudo...