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.
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.
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.
It's quite handy for for hacking someone else's systems and keeping your trojaned binaries from being deleted!!
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 :)
To keep pesky developers and hacking sysadmins off your ish.