3 AUTHOR: Nemmy <forever@subdimension.com>
6 How to prevent file deletion/modification, even from root.
9 ===========================================================================
10 Ed. note: as an unknown person explained:
11 "I was reading the lfs-hints and I came across the root-priveleges hint. I
12 am not sure if this is what was intended by the hint, but it sounds as if
13 any user can set this attr to a file and thereby prevent root from being
14 able to change/delete, etc.
16 That is not *quite* true. The superuser has to be the one to set and remove
17 the bit from a file. Once superuser sets this bit, then yes it is basically
18 unchangeable unless the bit is removed."
19 ===========================================================================
21 A less-known feature of the ext2 filesystem:
23 you can set a file to not be changable by anyone including root, like so:
25 chattr +i somefile.txt
27 this can be undone via the command:
29 chattr -i somefile.txt
31 Like this even root can't delete this file. See man chattr for more
34 e.g.: chattr +i -R /usr/lib would recursively change attributes of
35 directories and their contents.
37 Source: http://bastille-linux.sourceforge.net/faq.html