From b26d4f4bad1be8e709cc8ed8732891295abec9e0 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 30 Apr 2021 02:16:50 +0200 Subject: [PATCH] Add automatic TTY logout timeout --- root/etc/profile.d/shell-timeout.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 root/etc/profile.d/shell-timeout.sh diff --git a/root/etc/profile.d/shell-timeout.sh b/root/etc/profile.d/shell-timeout.sh new file mode 100644 index 0000000..f90b32f --- /dev/null +++ b/root/etc/profile.d/shell-timeout.sh @@ -0,0 +1,8 @@ +# Set automatic timeout for shell +# which will automatically log out the user after certain amount of time +# This will not work on termunal emulators in X11 +TMOUT="$(( 60*10 ))"; +[ -z "$DISPLAY" ] && export TMOUT; +case $( /usr/bin/tty ) in + /dev/tty[0-9]*) export TMOUT;; +esac