Although Gnu / Linux is a very secure operating system, the truth is that sometimes it happens that we delete files by mistake and then it's hard to get back. This can happen and more if our computer is shared.
Next we will tell you how to avoid this thanks to a program called rm-protection, a python program that will help us avoid these problems and avoid problems with external recovery programs. The operation of rm-protection is very simple as it avoids the accidental deletion of any file in Gnu / Linux.
First we have to install the RM-Protection program and in some cases we have to install special python plugins, for this we open a terminal and write the following:
Table of Contents
Arch Linux and derivatives
sudo pacman -S python-pip
RedHat / OpenSUSE
sudo yum install epel-release
sudo yum install python-pip
Debian / Ubuntu / derivatives
sudo apt-get install python-pip
Installation of the rm- protection program:
sudo pip install rm-protection
Once the program is installed, we have to select the files or directories that we want to encrypt, for this we only have to write the following:
protect -R carpeta/
Once enter is pressed, the program will ask us a security question and an answer. After establishing this, every time we try to delete a protected file, the operating system will ask us the question that we have marked before and we also have to enter the answer that we have entered before, as we wrote it, otherwise it will give an error and we will not be able to delete the archive. And although it seems tedious, we can do something like encrypt the home folder and make sure our files are not accidentally deleted.
The system that uses rm-protection is simple and the program has a basic operation, something that we can verify thanks to the github repository of the program, but it is fully functional because the question will make us determine what we are doing and what file we are deleting.