Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
10 years, 5 months ago
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
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 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,
visit the help center
10 years ago.
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.
Oct 25, 2012 at 17:26
1,276 1 1 gold badge 10 10 silver badges 30 30 bronze badges
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.
Oct 25, 2012 at 17:36
3,072 12 12 silver badges 19 19 bronze badges
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.
Oct 25, 2012 at 19:21
12.4k 2 2 gold badges 27 27 silver badges 41 41 bronze badges
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 :)
Oct 25, 2012 at 19:15
Tom Newton Tom Newton
4,091 2 2 gold badges 23 23 silver badges 28 28 bronze badges
To keep pesky developers and hacking sysadmins off your ish.
Oct 25, 2012 at 17:40
25.2k 2 2 gold badges 41 41 silver badges 70 70 bronze badges
Highly active question
. Earn 10 reputation (not counting the
) in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only