On Linux systems, I have a file I want to preserve from (even accidental) deletion.
How can I create a file even the root user can't delete?
For instance, by trying:
# touch file
# chmod 000 file
# chown <somebody>:<somebody> file
# rm file
root user is able to delete the file (through the last command).
How can I avoid root user to (even temporary) delete the file?
Set its immutable bit to prevent even root from deleting it: