The root account is an admin privileged account on a Linux system and by default is not having a high-security configuration for SSH. Therefore it is really very easy, with just a mistyped command, to wipe out the critical file system on a server. While using root users it’s always better to logout from the shell once work is done to avoid any issue because of mistyped command by mistake.
We often log in to the shell as a root user and leave it unattended without logging out after finishing our work. Logout from the shell automatically after a few minutes of idle time is one of the best options to avoid such issues. To do that, you must set the idle time variable in the main profile configuration file.
Edit the profile file and add the following line in the files
vi /etc/profile
TMOUT=7200
The value we enter for the variable ‘TMOUT=’ is in the seconds and represents two hours (60 * 60 = 3600 * 2 = 7200 seconds), you can adjust the time as per your requirement in each user .bashrc file as well.