The Terminal Security Cycle
:
- Autologout: to protect system resources.
- Terminal Lock: to protect from unauthorized access.
BASH/KSH/ZSH#
To setup auto-logout where after 10 min (7200 seconds) of inactivity at current login:
$ export TMOUT=7200
To unset or disable the auto-logout feature for current login:
$ export TMOUT=0
To setup and enforce the auto-logout:
$ export TMOUT=7200
$ readonly TMOUT
$ export TMOUT
To bypass the enforcement (by starting another shell instance):
$ export TMOUT=7200
$ readonly TMOUT
$ export TMOUT
$
$ exec env TMOUT=0 zsh
$
CSH/TCSH#
To setup auto-logout where after 10 min of inactivity at current login:
$ set -r autologout 10
$
ScreenRC#
In Linux shell environment, screen
is a terminal multiplexer.
It allows users to manage multiple terminal sessions within a single window or terminal.
There are 2 ways to protect your shell.
ctrl-a
+X
: To lock thescreen
session.- Set
idle 900
in.screenrc
file: It will respect the idle timeout and lock the session.
Virtual Console Lock#
vlock
(Virtual Console Lock) is a command-line utility in Linux used to lock one or more virtual consoles (TTYs).
This ensures that no one can access the console without providing the correct user password.
It is especially useful in multi-user environments where multiple people may have access to the same machine.
To lock the current console:
$ vlock
Or, to lock all virtual consoles:
$ vlock -a
This is can be useful to lock ther terminal securely when you step away, just like screen-saver. The terminal remain locked until the cirrect user password is entered.