Tuesday, March 25, 2008

How to protect files from users or unalterable by anybody

How to protect files from users or unalterable by anybody


  
How to make a File "immutable" or "unalterable" -- it cannot be changed
or deleted even by root. Note this works on (ext2/ext3) filesystems.
And, yes, root can delete after it's changed back.


As root:


$ chattr +i filename


And to change it back:


$ chattr -i filename


List attributes

$ lsattr filename
For more info please try man chattr & man lsattr

No comments: