secure deletion of data

最後更新: 2019-03-06

目錄

 


shred

 

Overwrite the specified FILE(s) repeatedly

Opts

  • -n, --iterations=N       # overwrite N times instead of the default (3)
  • -v, --verbose              # show progress
  • -z, --zero                   # add a final overwrite with zeros to hide shredding
  • -u                             # truncate and remove file after overwriting
                                    #   The default is not to remove the files
                                    #   because it is common to operate on device files like "/dev/sdb"

i.e.

shred -vz /dev/sdb

CAUTION

shred relies on a very important assumption: that the file system overwrites data in place

This is the traditional way to do things,

  but many modern file system designs do not satisfy this assumption. (i.e. btrfs)

 * ext? 也不一定是 overwrites data in place !! (data=journal mode)

 


wipe

 

i.e.

wipe /etc/shadow.bak

Okay to WIPE 1 regular file ? (Yes/No) Yes
Wiping /etc/shadow.bak, pass 34 (34)
Operation finished.
1 file wiped and 0 special files ignored in 0 directories,
  0 symlinks removed but not followed, 0 errors occurred.

wipe -Dk /dev/vg3t/backup

wipe -rq /home/plaintext/

Opts

-D  

Dereference symlinks

By default, wipe will never follow symlinks

-k  

Keep files
do not unlink the files after they have been overwritten
(wipe a device, ie. sdX)

-r

recurse into subdirectories

-q

quick mode

4 passes on each file, writing random data.

 

Creative Commons license icon Creative Commons license icon