Keeping your root terminal open when other people have physical access to your computer, makes your computer as secure as your normal user account. And if a remote attacker gains access to your normal user account, they also get access to your (in theory) open root terminal.
Turning the root terminal off when not in use is basic security practice.
If you still keep forgetting to log out, it can be done automatically. These commands will make the root terminal log out automatically after a given number of seconds:
As root:
Code: Select all
# echo "[ $USER = root ] && export TMOUT=300" >> /etc/profile
As you can see, the time limit is five minutes (300 seconds). Replace 300 with whatever number of seconds you want.
Load the new settings:
Your open root terminals will now automatically log off as root within the given number of seconds.
Credits:
http://linuxg.net/quick-tip-automatical ... nactivity/