If you have files containing sensitive information, you can delete these files using a more secure method so they can’t be recovered and viewed. We’ll show you a few ways to do this in Linux. If you want to know how to securely delete files in Linux, follow our guide below.
Should You Use Secure Deletion Tools on an SSD?
The tools we discuss here are for use only with regular spinning hard drives (HDDs). To be clear—do not use secure deletion tools on solid state drives (SSDs). You can only write files to an SSD a finite number of times. By using secure deletion tools, you’re adding to the amount of data being written to it, which can cause an SSD to fail much sooner. If you want to securely wipe files from an SSD, check your manufacturer’s user manual first. It may recommend specific tools for the task. Another alternative is to consider encrypting your hard drive. This will allow you to delete files normally while maintaining a high level of data security.
How to Securely Delete Files in Linux Using secure-delete
Secure-Delete is a set of tools for Linux that includes a tool to securely delete files by overwriting the hard disk space containing the files during deletion. There are four tools in the set. We’re going to use the srm tool. The other three tools allow you to overwrite the free space on the disk (sfill), overwrite swap space (sswap), and wipe the RAM (sdmem).
How to Install secure-delete
To install secure-delete in Ubuntu, follow these steps:
How to Securely Delete a File Using the srm Command
The srm command works similarly to the rm command, which removes and deletes a file. However, the srm command overwrites the file multiple times with random data before deleting the file. To securely delete a file using the srm command, follow these steps:
How to Securely Delete Files in Linux Using shred
Shred is another tool for securely deleting files. It overwrites the contents of a file multiple times with randomly generated data to make it unrecoverable. Then, you can choose to delete the file.
How to Check if Shred is Installed
Shred is installed by default on all Linux distributions. You can check and find its installation path. To check if shred is installed:
How to Securely Delete a File Using Shred
To securely delete a file using shred, follow these steps:
How to Securely Delete Files in Linux Using Wipe
The wipe command-line utility writes special patterns 34 times to files, eight of which are random. This is the most thorough method of securely deleting files, but it can also take a long time.
How to Install Wipe
To install wipe, follow these steps:
How to Securely Delete a File using wipe
To securely delete a file using wipe, follow these steps:
Protect Your Private and Sensitive Data
The steps above give you plenty of options to get started if you’re unsure how to securely delete files in Linux. You can also securely delete files on Mac and on Windows. You should consider protecting your data even further by using strong passwords and checking the strength of your current passwords. We recommend using a password manager like LastPass or 1Password to help store your passwords and other sensitive information. Comment Name * Email *
Δ Save my name and email and send me emails as new comments are made to this post.