I'm working on an Ubuntu based browser distro that is meant to be ran live. Part of the security solution is to use sdmem when it shuts down. sdmem wipes the available ram and is found in the package secure-delete in Ubuntu repos. sdmem is not being called in the scripts below.
I've had this solution working for another project set up the same way, so I know it works. But sometimes in the other project on shutdown and restart I didn't always get the standard out that sdmem gives when wiping. (Normally sdmem spits out a bunch of asterisks.) I've disabled graphical plymouth so I can look for the output.
Here is my script info:
internet@linux-surfer /etc/init.d $ cat dram.sh
#!/bin/sh
# give this script permissions:
# chmod +x sdmem.sh
# sdmem will delete data which may lie still in your memory (RAM)
# The secure data deletion process of sdmem goes like this:
# * 1 pass with 0x00
# * 5 random passes. /dev/urandom is used for a secure RNG if available.
# * 27 passes with special values defined by Peter Gutmann.
# * 5 random passes. /dev/urandom is used for a secure RNG if available.
sdmem -fllv
sdmem -fllv
sdmem -fllv
sdmem -fllv
sdmem -fllv
sdmem -fllv
sdmem -fllv
sdmem -fllv
sdmem -fllv
# this script need to be added to shutdown this way:
#sudo cp sdmem.sh /etc/init.d
#sudo ln -s /etc/init.d/sdmem.sh /etc/rc0.d/K11dram.sh
#sudo ln -s /etc/init.d/sdmem.sh /etc/rc6.d/K11dram.sh
Permissions:
internet@linux-surfer /etc/init.d $ ls dram.sh -l
-rwxr-xr-x 1 internet internet 743 2012-02-18 00:31 dram.sh
Upstart script:
internet@linux-surfer /etc/init $ cat dram.conf
start on runlevel [06]
script
sdmem -fllv
end script
internet@linux-surfer /etc/init $
Permissions:
internet@linux-surfer /etc/init $ ls -l dram.conf
-rw-r--r-- 1 root root 55 2012-02-18 01:35 dram.conf