immutable
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| immutable [2015/12/22 19:00] – luke7858 | immutable [2015/12/22 19:03] (current) – luke7858 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| === Immutable File Permissions === | === 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. | 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 == | == Viewing Immutable permissions == | ||
| Line 11: | Line 13: | ||
| </ | </ | ||
| \\ | \\ | ||
| + | == Setting file attributes with chattr == | ||
| To prevent everyone (even root) from deleting a file: | To prevent everyone (even root) from deleting a file: | ||
| <sxh bash> | <sxh bash> | ||
| Line 22: | Line 25: | ||
| <sxh bash> | <sxh bash> | ||
| chattr -i file | chattr -i file | ||
| + | </ | ||
| + | \\ | ||
| + | \\ | ||
| + | == Restricting Editable files == | ||
| + | You can use the +a attribute to allow users to append information into a file only: | ||
| + | <sxh bash> | ||
| + | chattr +a | ||
| </ | </ | ||
immutable.1450810829.txt.gz · Last modified: (external edit)
