Monthly Archives: July 2021

Removing files and folders with secure-delete

Deleting files on Linux is as simple as: rm file_name
Deleting folders is simple as well: rm -r folder_name

Both of these fail from the security standpoint since the content is still present on the hard drive until the blocks that hosted it get overriden with some new data.

To delete files and folders securely there are, at least, two options

  1. Use dd commands. This can go wrong quickly if done incorrectly.
  2. Install secure-delete. On Debian: sudo apt-get install secure-delete

When secure-delete is installed then deletion of file is as simple as:

srm file

For folders:

srm -r folder

The only thing getting added here is the letter s. However, when you are deleting multiple objects be prepared to wait for some time. For example: Getting rid of an old userĀ“s home directory was about 40 minutes of waiting with Ryzen3 3100 machine having an SSD and 8GB of DDR4.