Home » Questions » Computers [ Ask a new question ]

How to set a Linux Ditribution to self-destruct (to wipe everything from the system partition) via a script

How to set a Linux Ditribution to self-destruct (to wipe everything from the system partition) via a script

I shall be helping to facilitate a course that uses licensed software. The software is somewhat expensive and allows only a limited number of concurrent installations, so what I'll do is to install one instance on an encrypted Virtual Disk with Ubuntu (or some other flavor of linux) installed. Just to lessen the chance of any unnecessary pirating from occurring, I intend to schedule (using cron) a self-destruct script to run immediately after the last day of the course. (Or at the latest, during the first instance of boot up after the last day.)

Asked by: Guest | Views: 255
Total answers/comments: 2
Guest [Entry]

"As mentioned several times, deleting the encrypted image should be more than enough. Another approach would be to install the application on its own partition and wipe it afterwards with dd.

dd if=/dev/zero of=/dev/TARGETPARTITION bs=1M

This will overwrite everything with zero which is enough to delete the data beyond recovery."
Guest [Entry]

"A bit old but ok. According to that setup, I would rather indeed just encrypt the VM filesystem, and during sessions (assuming they are networked) you would remotely login. If they would copy the VM they would have to bruteforce the password, hardly what your users should be up to :)

i.e. if you don't mind you can encrypt a mountpoint: Note: this protection system is illegal apparently in some countries/states? (well in US but you seem to be from England?):

Setting up an encrypted, passworded mount:

dd if=/dev/urandom of=/home/user/virtualfolder bs=16065b count=100
modprobe loop
modprobe cryptoloop
modprobe aes
losetup -e aes /dev/loop1 ./virtualfolder
password: <enter your password here which you don't show to the users>
mkreiserfs /dev/loop1
mkdir /theprogram
mount -o loop,encryption=aes,acl ./virtualdrive /theprogram
password:<enter the same passy>

Now install/move your program into /theprogram

(Each time you want to access /theprogram again do):

mounting

mount -o loop,encryption=aes,acl ./virtualdrive /theprogram
password:<enter the same passy>

unmounting

umount /theprogram
losetup -d /dev/loop1
rmmod aes
rmmod cryptoloop
rmmod loop

When done, make the software folder look like just a file of random bytes.

You can also make sure the user accounts they use during the VM session do not have su rights in case they copy whole thing."