Does anyone have real world scenarios where they've used the immutable flag in Linux?
chattr +i file.txt
Since root can unset the attribute, it seems like you're protecting the file against users who have root access but aren't aware of the feature.
|
Does anyone have real world scenarios where they've used the immutable flag in Linux? chattr +i file.txt Since root can unset the attribute, it seems like you're protecting the file against users who have root access but aren't aware of the feature. |
|||
|
|
|||
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer: please explain why you're recommending it as a solution. Answers that don't explain anything will be deleted. See Good Subjective, Bad Subjective for more information. |
|||
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
|
I've seen this used in virtual hosting setups where file(s) need to remain in directories that users have access to, e.g. php5.fcgi. I also occasionally use it to add an extra step to deleting important files, to protect them from my own absent-mindedness. |
|||
|
|
|
I use this on any directory that is only intended to be a mount point. It prevents files from mistakenly getting written if the file system isn't mounted. |
|||
|
Usually to protect against automatic deletion of the file, eg. through cleaning of temporary directories etc. though of course you have to hope whatever might delete that file behaves well on failure :) |
|||
|
|
It's quite handy for for hacking someone else's systems and keeping your trojaned binaries from being deleted!! |
|||||||
|
|
To keep pesky developers and hacking sysadmins off your ish. |
|||
|
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.