Shredding data on linux with an interactive script

Shred the data

Securely deleting ones data is very much in the spotlight at the moment and its no different for me. We have to securely delete data from a number of different web servers but also from local desktops that might be destroyed all the time. I’ve written a script that you can load onto the linux system that you need to shred the data on, the script will ask you for a location to shred the data e.g. /var/www/serv and shred all data 30 times over (which is a bit of overkill) and then remove the files. We are going to use a pre-installed linux program called shred, if you dont have shred just install via your package manager (e.g. for ubuntu apt-get install shred)  Shred works by repeatedly over writing the data so the original data is much harder (if possible) to recover . The two man switches we use here are -n which is the number of times we want to overwrite the data and -u to remove the files after the overwrite.

At the bottom of the script I’ve hashed out a shred command to delete the whole partition so you can see how easy it can be. We can also modify the script to allow the user to enter the times he/she wants to shred, we could add an email component to confirm once finished and even logging to show how many files have been deleted (just added this). Shred will not be as affective on filesystems that do not overwrite the data which is worth noting

Hope you find the script useful, its been used about 20 times so far by me. Please note that the code syntax formatting I’m using is converting “>>” to “>&gt” sorry about this will try to work out whats going wrong


Leave a Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>