Home >> Linux >> How to make a File “immutable” or “unalterable”

How to make a File “immutable” or “unalterable”

If you want that no one can delete or modify any File in Linux, mean 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:

[amit@localhost] # chattr +i filename

And to change it back:

[amit@localhost] # chattr -i filename

List attributes

[amit@localhost] # lsattr filename

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*