immutable
This is an old revision of the document!
Immutable File Permissions
Chattr is a command that can be used to set file attributes that can prevent all users (even root) from deleting a file.
Viewing Immutable permissions
1 |
lsattr file |
1 |
----i---------- filename |
Setting file attributes with chattr
To prevent everyone (even root) from deleting a file:
1 |
chattr +i file |
To undo this:
1 |
chattr -i file |
Restricting Editable files
You can use the +a attribute to allow users to append information into a file only:
1 |
chattr +a |
immutable.1450810991.txt.gz · Last modified: 2024/05/23 07:26 (external edit)