How do I make a file permanently read-only on Linux so even root can not edit it?
linux
Solution
There is an "immutable" bit for files.
Programs (even running as root) won't be able to tamper with the file. Of course, root can un-do the bit, but most programs (especially non-malicious ones) won't get past it.
Set it with
sudo chattr +i file
Problem
If I would like to lock a file as read-only. Even root can not use an editor to modify it, just allowing any program to open it read-only. Any suggestions?