how to securely and permanently delete a file? [closed]
How to delete a file in linux securely and permanently, so it can never be recovered?
How to delete a file in linux securely and permanently, so it can never be recovered?
$ yum install srm
$ srm myfile.txt
srm removes each specified file by overwriting, renaming, and truncating it before unlinking.
This prevents other people from undeleting or recovering any information about the file from the command line.
Instead of just overwriting your files with random data, it uses a special process – a combination of random data, zeros, and special values developed by cryptographer Peter Gutmann – to really, really make sure your files are irrecoverable.
It's interesting too scrub, and very useful if you want to, well, scrub deeply a file, a whole partition/disk before creating an encrypted partition, or your free space. And it is actually very fast.
or use the command shred
As tezcatl says scrub and dd are good choices. If you're wiping a whole disk make sure to change the bs=BYTES option (see `man dd') and experiment a little (depends on the HDD), as this can speed the process up e.g.
dd bs=8M if=/dev/zero of=/dev/hdd
There is also no need to overwrite something more than once [1].
[1][https://en.wikipedia.org/wiki/Gutmann_method#Criticism](https://en.wikipedia.org/wiki/Gutmann_method#Criticism)
This is actually a good option on solid state media like USB pendrives, however I wonder if forensics software like Photorec [1] could recover the "erased" file in this type of media.
It could not. It's possible that organizations like the NSA could recover it if they wanted the data badly enough and could spend a bunch of money working on it and it was only overwritten once, especially with just zeros, but that will certainly foil any recovery software.
As for the "Gutmann Method", yes, you don't need 35 passes, but I would not trust 1 pass with zeros to foil the NSA. (But it would make their job hard.) Maybe two passes with random data would foil them completely, however.
Asked: 2011-09-29 00:33:39 -0600
Seen: 5,972 times
Last updated: Feb 09 '12