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?
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?
文件有一个“不可变”位。
程序(即使以 root 身份运行)将无法篡改文件。当然,root 可以取消这一点,但大多数程序(尤其是非恶意程序)都无法通过它。
设置它
sudo chattr +i file
你应该有根烫发
sudo chattr +i file