Security – How to Trigger System Self Destruct with Password

passwordSecurity

How do I configure my system to destroy all personal data when a certain password is entered? The motivation behind this being NSA stuff.

I imagine there being three primary usage cases.

  1. At login, the entering of a predetermined password triggers destruction of user data.
  2. At system wake up. entering of a predetermined password triggers destruction of personal data.
  3. Entering any privileged command with a predetermined password triggers destruction of personal data.

I know that something like

dd if=/dev/urandom of=/dev/$HOME

Should be adequate for data destruction. I don't know how to have that triggered by a certain password, however.

Bonus points if it then permits a login while the data is being deleted.

Best Answer

Idea #1 - Hidden OS

As an alternative method you could make use of TrueCrypt's "Hidden Operating System". This allows you to access a fake alternative OS when a certain password is used, rather than the primary OS.

excerpt

If your system partition or system drive is encrypted using TrueCrypt, you need to enter your pre-boot authentication password in the TrueCrypt Boot Loader screen after you turn on or restart your computer. It may happen that you are forced by somebody to decrypt the operating system or to reveal the pre-boot authentication password. There are many situations where you cannot refuse to do so (for example, due to extortion). TrueCrypt allows you to create a hidden operating system whose existence should be impossible to prove (provided that certain guidelines are followed — see below). Thus, you will not have to decrypt or reveal the password for the hidden operating system.

Bruce Schneier covers the efficacy of using these (Deniable File Systems, so you might want to investigate it further before diving in.

The whole idea of Deniable Encryption is a bit of a can of worms, so caution around using it in certain situations needs to be well thought out ahead of time.

Idea #2 - Add a script to /etc/passwd

You can insert alternative scripts to a user's entry in the /etc/passwd file.

Example

# /etc/passwd
tla:TcHypr3FOlhAg:237:20:Ted L. Abel:/u/tla:/usr/local/etc/sdshell

You could setup a user's account so that it runs a script such as /usr/local/etc/sdshell which will check to see what password was provided. If it's the magical password that triggers the wipe, it could begin this process (backgrounded even) and either drop to a shell or do something else.

If the password provided is not this magical password, then continue on running a normal shell, /bin/bash, for example.

Source: 19.6.1 Integrating One-Time Passwords with Unix

Related Question