Usually chattr is used for changing the file attributes on Linux file system. It is different from chmod command. Any file’s permission set by chmod command can be bypassed with the root privilege. Whereas if a file is set immutable by the chattr command it cannot be modified even with super user privilege. Afterall chattr command can be used only with super user privilege. Even though it is more efficient than chmod.
To set a file immutable run
chattr +i file
with super user privilege.
In GNU/Linux the root access is the basis for any system level alterations. Administrators stay on as ‘root’ or forget to logout after finishing their work and leave their terminals unattended.The answer to solve this problem is to make the bash shell automatically logout after not being used for a period of time. For this we use the special linux variable TMOUT to set the time.
1. Login as root
2. Switch to the root home directory (by default it will
be in the root home)
3. Run nano .bashrc
4. Add the line TMOUT=3600 after ‘HISTFILESIZE=…’
5. Save the file and exit.
Note : The time is given in seconds i.e, 3600 = 1 hour.