Thursday, September 27, 2012

Deleting and overwriting data securely on Debian Linux

Sometimes, we may need to delete the data securely. Overwriting the data with "shred" could be a solution.

Here, "securely" means that it is very difficult to recover the data. The term "data" here means the files.

I should back up the important data first before deleting anything!

After deciding that the file or files should be deleted and should not be recovered, I followed the following steps:

For a file, I used

shred -uv nameOfFile



For many files in the current folder or directory, I used

find . -depth -exec shred -uv {} \;

According the manual, the options carry these meanings:       

-u or --remove means "truncate and remove file after overwriting".

-depth means "process each directory's contents before the directory itself". This may prevent potential problems when the directory is deleted first, instead of the files inside it.


References

I visited this page.
For the information from the manual, I used "man shred" and "man find".

No comments: