Practical uses of the immutable flag in Linux [closed]

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.


Solution 1:

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.

Solution 2:

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.