shred

简介: shred - delete a file securely, first overwriting it to hide its contents   SYNOPSIS shred [OPTIONS] FILE [.

shred - delete a file securely, first overwriting it to hide its contents  

SYNOPSIS

shred [OPTIONS] FILE [...]  

DESCRIPTION

Overwrite the specified FILE(s) repeatedly, in order to make it harder for even very expensive hardware probing to recover the data.

Mandatory arguments to long options are mandatory for short options too.

-f, --force
change permissions to allow writing if necessary
-n, --iterations= N
Overwrite N times instead of the default (25)
-s, --size= N
shred this many bytes (suffixes like K, M, G accepted)
-u, --remove
truncate and remove file after overwriting
-v, --verbose
show progress
-x, --exact
do not round file sizes up to the next full block
-z, --zero
add a final overwrite with zeros to hide shredding
-
shred standard output
--help
display this help and exit
--version
output version information and exit

Delete FILE(s) if --remove (-u) is specified. The default is not to remove the files because it is common to operate on device files like /dev/hda, and those files usually should not be removed. When operating on regular files, most people use the --remove option.

CAUTION: Note that shred relies on a very important assumption: that the filesystem overwrites data in place. This is the traditional way to do things, but many modern filesystem designs do not satisfy this assumption. The following are examples of filesystems on which shred is not effective:

* log-structured or journaled filesystems, such as those supplied with

AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)

* filesystems that write redundant data and carry on even if some writes

fail, such as RAID-based filesystems

* filesystems that make snapshots, such as Network Appliance's NFS server

* filesystems that cache in temporary locations, such as NFS

version 3 clients

* compressed filesystems

In addition, file system backups and remote mirrors may contain copies of the file that cannot be removed, and that will allow a shredded file to be recovered later.  

SEE ALSO

The full documentation for shred is maintained as a Texinfo manual. If the info and shred programs are properly installed at your site, the command

info shred

should give you access to the complete manual.

 

. 是什么?

shred 是一个可以将你硬盘上的数据彻底清除杜绝恢复的工具. 它的基本原理是先往硬盘或

. 为什么?

昨天我离开原来的公司了, 需要把硬盘上的数据 "洗净", 避免别人可以通过一些数据恢复软件找回经意不经意间留下的敏感数据 (比如我的 QQ 聊天记录, 银行账号信息 - 谁知道 IE 有没有自作聪明给我存哪个旮旯里了).

假如某天你要把自己的机器 (尤其是硬盘), 也务必把硬盘 "洗" 一遍, 免得泄漏个人敏感信息.

. 怎么用?

随便找一张 linux 的启动盘/安装盘/Live CD (我用的是 FC4 的第一张安装盘), 光驱启动到命令行下 (FC4 的安装盘可以通过 boot: linux rescue 进入), 然后敲敲 shred --help, 如果有输出帮助, 那么说明有这工具, 我们可以开始 "洗" 盘了!

[!!! 注意 !!!] 确保你要留下的东西都备份好了, 或者你真的想这么干掉数据, 否则, shred 删掉的东西是无法找回的! shred 的目的就是为了让数据彻底毁灭而诞生的!! 删错东西了别哭噢!! [!!! 注意 !!!]

最简单最直接的 - 清掉整个硬盘里的数据 (假设你的硬盘是 /dev/hda): shred -vz -n 3 /dev/hda

v 表示输出运行时的信息; z 表示清除完毕之后往硬盘里填 0; -n 3 表示用随机数据把硬盘覆盖三次 (如果不指定的话, 默认是覆盖 25 次!)

如果要清某个分区, 比如象我 windows 的 C 盘对应的是 /dev/hda1, D 盘是 /dev/hda2, 我只想清这俩盘, 那就这样:

shred -vz -n 3 /dev/hda1 && shred -vz -n 3 /dev/hda2

然后你会看到 shred 会有 4 个 pass, 也就是把目标硬盘/分区刷四次, 其中前三次是用随机数据覆盖, 最后一次是填 0.

选择 -n 3 是考虑到付出与收获的平衡, 由于整个硬盘或分区一般都比较大, 如果默认覆盖个 25 次, 估计得用上你一天的时间, 如果你的电脑秘密服务于国家特殊机关, 那必要是就这么干吧...

以上是清硬盘清分区的做法, 我们还可以用它来彻底毁灭某个文件, 你只需把 /dev/hdaX 这样的设备文件换成你想干掉的文件就可以了 (这也是 *nix 的优雅之处 - 所有东西都是文件:), 例如:

shred -vz AmericanVideo.avi

覆盖它 25 次! 呵呵, 这就污渍油渍, 不留痕迹了 ;)

目录
相关文章
|
JSON 弹性计算 网络协议
阿里云公共DNS安全传输服务介绍(DoH/DoT)
传统的DNS查询和应答采用大都采用UDP明文传输,存在网络监听、DNS劫持、中间设备干扰的风险。为了应对以上挑战,阿里公共DNS对外提供支持DoH/DoT的云服务,为广大的互联网用户提供快速、稳定和安全的DNS解析,欢迎大家使用!
阿里云公共DNS安全传输服务介绍(DoH/DoT)
|
7月前
|
开发者
app备案
app备案
4940 2
|
缓存 安全 搜索推荐
Cors跨域(三):Access-Control-Allow-Origin多域名?
Cors跨域(三):Access-Control-Allow-Origin多域名?
Cors跨域(三):Access-Control-Allow-Origin多域名?
|
存储 自然语言处理 搜索推荐
【es】elasticsearch/es搜索服务器介绍
ElasticSearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开放源码发布,是当前流行的企业级搜索引擎。设计用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便。
684 0
【es】elasticsearch/es搜索服务器介绍
|
PHP 开发工具 数据安全/隐私保护
PHP使用phpmailer及SMTP服务实现邮件发送
第一种是PHP通过qq邮箱或者网易邮箱的SMTP服务器来实现邮件发送。 第二种是使用phpmailer来实现邮件发送。
594 0
PHP使用phpmailer及SMTP服务实现邮件发送
|
Ubuntu
WSL2重启
WSL2重启
12271 0
|
Linux 数据库 数据安全/隐私保护
Linux基础命令---sendmail发送邮件
sendmail sendmail是postfix中的一个发送邮件的代理程序,它负责发送邮件到远程服务器,并且可以接收邮件。sendmail在发送邮件的时候,默认从标砖输入读取内容,以“.”为结束。
6825 1
|
Linux 网络安全
Linux禁止ping以及开启ping的方法
Linux禁止ping以及开启ping的方法Linux默认是允许Ping响应的,系统是否允许Ping由2个因素决定的:A、内核参数,B、防火墙,需要2个因素同时允许才能允许Ping,2个因素有任意一个禁Ping就无法Ping。
2155 0