Trace: Idle Log-out

Idle Log-out

Idle Log-out

If you want idle sessions to be logged out automatically, put something like the following into /etc/profile.d/timeout.sh (or another similar name). In modern distributions (Gentoo and RHEL5) placing the file in /etc/profile.d/ should cause it to be automatically executed at each log-in.

[ -n "${TMOUT}" ] && readonly TMOUT
[ -z "${TMOUT}" ] && declare -irx TMOUT=7200

This sets a 7200-second (2-hour) time-out and makes the variable read-only so that it cannot be changed by the user.