Re:How to take back control of /etc/resolv.conf on Linux (2018)
by ktpsns on Tuesday March 19, 2019 @05:32PM
(#19436172)
Wow, I wasn't aware of the chattr command at all. Here is a list of available: https://en.wikipedia.org/wiki/Chattr
Apparently, they are very file system specific. That's why they are not widely used. I guess a chmod 0444 would not do it, as system tools tend to "fix" wrong permissions automatically (but not permissive attributes).
Re:How to take back control of /etc/resolv.conf on Linux (2018)
by j7k6 on Tuesday March 19, 2019 @06:17PM
(#19436646)
I use `chattr +i` with NFS mountpoints for backups, it prevents the local harddrive from filling up when a network share fails to mount on boot.
Re:How to take back control of /etc/resolv.conf on Linux (2018)
by muxator on Tuesday March 19, 2019 @07:02PM
(#19437038)
Totally. If something is meant to be a mount point, a chattr +i on the underlying directory is a godsend, because it gives you an immediate error in case the mount should fail for whatever reason.
That prevents anything, even root, from changing the file, unless chattr -i is called first.