How to install chattr on Debian to make files immutable
January 28, 2019
chattr is a program that you can install on Debian (and other systems) to change various attributes of files. I've recently used chattr to make files immutable. When a file is made immutable by chattr, it makes it so that the file can't be changed - not even by root!
To install chattr on Debian, and probably on Ubuntu and other Debian derivatives, you can install the e2fsprogs package.
To install the e2fsprogs package on your Debian computer, just run the following command:
apt-get install e2fsprogs
Now chattr will be installed on your system and you can make a file immutable by running:
chattr +i /path/to/filename