Eu sei que esta pergunta é em relação ao Bash & Ksh. Mas pensei em publicar algo semelhante para csh / tcsh, para o registro.
No FreeBSD, o shell padrão é tcsh. Você pode fazer logout automático de uma sessão usando o autologout
recurso do shell tcsh.
A seguir, a inscrição será encerrada automaticamente após um minuto de atividade ociosa.
freebsd82# set -r autologout=’1′
(Wait one minute)
freebsd82# auto-logout
Connection to freebsd82 closed.
A página de manual do tcsh (1) descreve assim:
autologout (+)
The first word is the number of minutes of inactivity before
automatic logout. The optional second word is the number of
minutes of inactivity before automatic locking. When the shell
automatically logs out, it prints `auto-logout', sets the vari-
able logout to `automatic' and exits. When the shell automati-
cally locks, the user is required to enter his password to con-
tinue working. Five incorrect attempts result in automatic
logout. Set to `60' (automatic logout after 60 minutes, and no
locking) by default in login and superuser shells, but not if
the shell thinks it is running under a window system (i.e., the
DISPLAY environment variable is set), the tty is a pseudo-tty
(pty) or the shell was not so compiled (see the version shell
variable). See also the afsuser and logout shell variables.