December 2018
Beginner
826 pages
22h 54m
English
I'm starting to think we've been much too lenient here, so let's completely lock down the file so no one (even almighty root) can mess with it:
$ sudo chattr +i permissionfile
We've made the file immutable!
$ echo "RFCs are great if boring." > permissionfile-bash: permissionfile: Permission denied
We can see this using the lsattr command:
$ lsattr permissionfile----i----------- permissionfile
And, not even root is able to modify the file:
$ sudo echo "RFCs are great if boring." > permissionfile-bash: permissionfile: Permission denied
To remove the attribute, use chattr again:
$ sudo chattr ...