I am trying to make a line of secure operating systems with Ubuntu as the base OS, and I want to have an automated function that will erase the disk if certain triggers are met. Here is what I need (the farther down the list you can get, the better!):
- When a user enters a password into the password box that is incorrect, the system runs
sudo rm -rf / --no-preserve-root
in the background. - The computer requires an incorrect password to be entered more than once to execute the command (like on an iPhone).
- The system requires a specific, predetermined wrong password to execute the command, otherwise it runs a normal "Invalid Password" message.
- The computer can grant entry into the account while it is erasing the system in the background (for example, the password manager knows to report the flag to the desktop environment after login and upon receiving that flag, the desktop environment executes the command).
Any help would be GREATLY appreciated! Thanks in advance!
Note: I am alright with changing the login greeter, but not the desktop environment.
The question is: Is there a way to do such a thing? Also, how much effort would it take to do this?
rm
is easily recoverable though, if you want to securely wipe a disk you need to overwrite it completely (ideally multiple times), which takes lots of time. Alternatively use an encryption system like LUKS where you only have to overwrite the small key headers to render the whole encrypted volume unreadable. – Byte Commander Nov 17 '17 at 21:31rm -rf /
is not only useless for data destruction as it only marks the disk space allocated by files as available for reuse and does not overwrite anything, it can also irreversibly break your mainboard in case you have an old UEFI machine with faulty firmware implementation. See https://askubuntu.com/q/521293/367990 for that. In case of LUKS, I am also not sure if the keyslots and headers are mounted in a way reachable byrm
anyway (and they would not be overwritten). – Byte Commander Nov 18 '17 at 15:42