Do you ever worry about users not logging out of the bash when leaving the computer unattended?
I do! Especially the Linux root account.
There is actually a way to set a timeout on this.
You can set the TMOUT environment variable to the timeout in seconds.
Below example sets the timeout to 600 seconds.

declare -r TMOUT=600
or
readonly TMOUT=600

The above two lines do the exact same thing.
The -r parameter in the first line makes it read only.

I believe it should work from both "/etc/profile" and "/etc/bashrc".
Adding it to a system wide file that users have read only acces to should be our first choice.

It should also work fine from the "~/.bashrc" and "~/.profile" in the home folders.
To avoid adding this manually for all future users you can modify "/etc/skel/.bashrc" or "/etc/skel/.profile".
Wether both .bashrc and /.profile are always executed I dont know.

Remark that this is not bullet proof.

The timer works from when a prompt is opened. When the timeout occour the user is logged out.
Is the shell executed from the X environment the bash will simply exit. It shouldnt be a problem in X if the screensaver locks the screen. Sometimes the screensaver doesnt work as intended on the root user.