Categorized | General, Linux, Security, Ubuntu

Securely Delete Files in Linux

Posted on 10 October 2007 by admin

WebWatcher-Get 40% Off

It used to be that only geek conspiracy theorists would worry about securely deleting their info.  But nowadays almost everybody has put on an aluminum hat and is worried about their personal data falling into the wrong hands.  For you aluminum hat junkies there is a nice utility on most Linux ditros to securely delete your files.

Shred is a simple command line utility that’s included with many Linux distributions, and it repeatedly overwrites a file with garbage data to render the file unrecoverable. Used in its simplest form (simply ’shred <filename>’), it will overwrite the file 25 times to obscure everything in it, and leave the file on your drive. But with the addition of command arguments, Shred becomes much more powerful and effective.

The shred command arguments are: [from the Shred help file]

-f, –force (change permissions to allow writing if necessary)
-n, –iterations=N (Overwrite N times instead of the default (25))
-s, –size=N (shred this many bytes (suffixes like K, M, G accepted))
-u, –remove (truncate and remove file after overwriting)
-v, –verbose (show progress)
-x, –exact (do not round file sizes up to the next full block; this is the default for non-regular files)
-z, –zero (add a final overwrite with zeros to hide shredding)
–help (display help and exit)
–version (output version information and exit)

For example, to delete a file called temp.log securely, open Terminal and type

shred -vfzu temp.log

which would turn on verbose mode (v) to show you what Shred is doing,
force file permissions to enable you to shred the document (f),
add a final overwrite of zeros to hide the shredding (z),
and then delete the file (u).

To add shred to the context menu open Terminal and type;

sudo apt-get install nautilus-actions

Then go to System – Preferences – Nautilus Actions Configuration.

Click import and select the shred.schemas file. When you restart your shell it will appear in the context menu.

NOTE: While this tool is helpful, and much better than ‘move to trash’, it is not a 100% secure method of data removal. Note that the man page for shred, has a caution warning that journaled file systems like ext3, ext2 and Reiser render this less effective since data is not necessarily overwritten in the exact same location as the original file.

  • Share/Bookmark

Tags | , , ,

Acronis True Image Home 2010

Comments are closed.

Categories