Secure-Delete

From ubuntugeek.com

The Secure-Delete tools are a particularly useful set of programs that use advanced techniques to permanently delete files. To install the Secure-Delete tools in Ubuntu, run the following command

sudo aptitude install secure-delete

The Secure-Delete package comes with the following commands

srm(Secure remove) – used for deleting files or directories currently on your hard disk.
smem(Secure memory wiper) – used to wipe traces of data from your computer’s memory (RAM).
sfill(Secure free space wiper) – used to wipe all traces of data from the free space on your disk.
sswap(Secure swap wiper) – used to wipe all traces of data from your swap partition.
srm – Secure remove

srm removes each specified file by overwriting, renaming, and truncat-ing it before unlinking. This prevents other people from undeleting or recovering any information about the file from the command line.

srm, like every program that uses the getopt function to parse its arguments, lets you use the — option to indicate that all arguments are non-options. To remove a file called ‘-f’ in the current directory, you could type either “srm — -f” or “srm ./-f”.

srm Syntax

srm [OPTION]… FILE…

Available Options

-d, –directory – ignored (for compatibility with rm)
-f, –force – ignore nonexistent files, never prompt
-i, –interactive – prompt before any removal
-r, -R, –recursive – remove the contents of directories recursively
-s, –simple – only overwrite with a single pass of random data
-m, –medium – overwrite the file with 7 US DoD compliant passes (0xF6,0×00,0xFF,random,0×00,0xFF,random)
-z, –zero – after overwriting, zero blocks used by file
-n, –nounlink – overwrite file, but do not rename or unlink it
-v, –verbose – explain what is being done
–help display this help and exit
–version – output version information and exit

srm Examples

Delete a file using srm

srm myfile.txt

Delete a directory using srm

srm -r myfiles

smem – Secure memory wiper

smem is designed to delete data which may lie still in your memory (RAM) in a secure manner which can not be recovered by thiefs, law enforcement or other threats. Note that with the new SDRAMs, data will not wither away but will be kept static – it is easy to extract the necessary information! The wipe algorythm is based on the paper “Secure Deletion of Data from Magnetic and Solid-State Memory” presented at the 6th Usenix Security Symposium by Peter Gutmann, one of the leading civilian cryptographers.

smem Syntax

smem [-f] [-l] [-l] [-v]

Available Options

-f – fast (and insecure mode): no /dev/urandom.
-l – lessens the security. Only two passes are written: the first with 0×00 and a final random one.
-l -l for a second time lessons the security even more: only one pass with 0×00 is written.
-v – verbose mode

sfill – secure free space wipe

sfill is designed to delete data which lies on available diskspace on mediums in a secure manner which can not be recovered by thiefs, law enforcement or other threats. The wipe algorythm is based on the paper “Secure Deletion of Data from Magnetic and Solid-State Memory” presented at the 6th Usenix Security Symposium by Peter Gutmann, one of the leading civilian cryptographers.

sfill Syntax

sfill [-f] [-i] [-I] [-l] [-l] [-v] [-z] directory/mountpoint

Available Option

-f – fast (and insecure mode): no /dev/urandom, no synchronize mode.
-i – wipe only free inode space, not free disk space
-I -wipe only free disk space, not free inode space
-l -lessens the security. Only two passes are written: one mode with 0xff and a final mode with random values.
-l -l for a second time lessons the security even more: only one random pass is written.
-v – verbose mode
-z – wipes the last write with zeros instead of random data

directory/mountpoint this is the location of the file created in your filesystem. It should lie on the partition you want to write.

sswap – Secure swap wiper

sswap is designed to delete data which may lie still on your swapspace in a secure manner which can not be recovered by thiefs, law enforce?ment or other threats.The wipe algorythm is based on the paper “Secure Deletion of Data from Magnetic and Solid-State Memory” pre?sented at the 6th Usenix Security Symposium by Peter Gutmann, one of the leading civilian cryptographers.

sswap Syntax

sswap [-f] [-l] [-l] [-v] [-z] swapdevice

Available Option

-f – fast (and insecure mode): no /dev/urandom, no synchronize mode.
-l – lessens the security. Only two passes are written: one mode with 0xff and a final mode with random values.
-l -l for a second time lessons the security even more: only one pass with random values is written.
-v – verbose mode
-z – wipes the last write with zeros instead of random data

sswap Examples

Before you start using sswap you must disable your swap partition.You can determine your mounted swap devices using the following command

cat /proc/swaps

Disable swap using the following command

sudo swapoff /dev/sda3

/dev/sda3 – This is my swap device

Once your swap device is disabled, you can wipe it with sswipe using the following command

sudo sswap /dev/sda3

After completing the above command you need to re-enable swap using the following command

sudo swapon /dev/sda3

From ubuntugeek.com

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....