lunedì 20 dicembre 2010

Securely delete files in Linux

Shred is a command line utility which can be used to securely delete files or entire file-systems.
It overwrites the file repeatedly (on my system default is 3 times, but can be specified) in order to make harder to recover the data with professional tools.
As usual for Unix's utility you can tune the program specifying parameters such as the number of overwrites.

Examples


Delete a single file:
shred -f -u -v /home/marco/file_with_secrets.txt
  • -f change permissions to allow writing if necessary
  • -u truncate and remove file after overwriting
  • -v show progress

Wipe an entire disk partition:
shred -n 10 -z -v  /dev/sdb3
  • -n # Overwrite # times instead of the default
  • -z add a final overwrite with zeros to hide shredding

Note: shred could be not so effective overwriting files in journaled file-systems (like ext3, ext4 ReiserFS, XFS, JFS) or RAID based file-systems.

Links:


shred invocation
shred - Linux man page

Nessun commento:

Posta un commento