免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1262 | 回复: 2
打印 上一主题 下一主题

[求助]如何使用 gpg 来校验文件? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-19 10:31 |只看该作者 |倒序浏览
在一些linux发行版和kernel网站的下载文件夹下常常有个类似 linux-2.6.15.tar.bz2.sign 或 slackware-10.0-install-d1.iso.asc 的文件,还有与之对应的文件 linux-2.6.15.tar.bz2 或 slackware-10.0-install-d1.iso。

请问:在linux下如何使用这个 sign 或 asc 文件来校验文件?

在Debian下需要安装什么软件吗?

论坛徽章:
0
2 [报告]
发表于 2006-01-27 20:36 |只看该作者
在 www.kernel.org 网站找到了一段文字,先要导入钥匙,然后才可以验证。

对于 linux kernel 的操作
1. 从 keyserver 导入 linux kernel 的钥匙:
% gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E

2. 用 asc 校验软件包:
% gpg --verify linux-2.3.9.tar.gz.sign linux-2.3.9.tar.gz

如果软件包正常,会显示如下信息:
gpg: Signature made Mon Oct  9 23:48:38 2000 PDT using DSA key ID 517D0F0E
gpg: Good signature from "Linux Kernel Archives Verification Key <ftpadmin@kernel.org>"



对于 apache 的操作
下载 KEYS 后导入:
% pgp < KEYS
然后应该就和上面的一样了吧。

在 apache 下载目录找到的 KEYS 中有这么一段:
Apache users: pgp < KEYS
Apache developers:
        (pgpk -ll <your name> && pgpk -xa <your name>) >> this file.
      or
        (gpg --fingerprint --list-sigs <your name>
             && gpg --armor --export <your name>) >> this file.

Apache developers: please ensure that your key is also available via the
PGP keyservers (such as pgpkeys.mit.edu).

Type Bits/KeyID    Date       User ID
pub  1024/2719AF35 1995/05/13 Ben Laurie <ben@algroup.co.uk>
                              Ben Laurie <ben@gonzo.ben.algroup.co.uk>



问题:是否可以用以下命令来从 keyserver 导入钥匙?这个命令对吗?
% gpg --keyserver pgpkeys.mit.edu --recv-keys 0x2719AF35

论坛徽章:
0
3 [报告]
发表于 2006-01-28 15:19 |只看该作者

[求助]我还是没学会校验

我从 www.kernel.org 下载了 linux-2.6.15.tar.bz2 和 linux-2.6.15.tar.bz2.sign,从 www.apache.org 下载了 httpd-2.2.0.tar.bz2 和 httpd-2.2.0.tar.bz2.asc 然后执行

校验一:
# gpg --keyserver pgpkeys.mit.edu --recv-keys 0x517D0F0E
gpg: requesting key 517D0F0E from hkp server pgpkeys.mit.edu
gpg: key 517D0F0E: duplicated user ID detected - merged
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 517D0F0E: public key "Linux Kernel Archives Verification Key <ftpadmin@kernel.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
# gpg --verify linux-2.6.15.tar.bz2.sign linux-2.6.15.tar.bz2
gpg: Signature made 2006年01月03日 星期二 13时19分03秒 CST using DSA key ID 517D0F0E
gpg: Good signature from "Linux Kernel Archives Verification Key <ftpadmin@kernel.org>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: C75D C40A 11D7 AF88 9981  ED5B C86B A06A 517D 0F0E


校验二:
# gpg --keyserver pgpkeys.mit.edu --recv-keys 0x2719AF35
gpg: requesting key 2719AF35 from hkp server pgpkeys.mit.edu
gpg: key 2719AF35: duplicated user ID detected - merged
gpg: key 2719AF35: public key "Ben Laurie <ben@thebunker.net>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
# gpg --verify httpd-2.2.0.tar.bz2.asc httpd-2.2.0.tar.bz2
gpg: Signature made 2005年11月29日 星期二 16时22分03秒 CST using DSA key ID 42721F00
gpg: Can't check signature: public key not found

# gpg --list-keys
/root/.gnupg/pubring.gpg
------------------------
pub   1024D/517D0F0E 2000-10-10
uid                  Linux Kernel Archives Verification Key <ftpadmin@kernel.org>
sub   4096g/E50A8F2A 2000-10-10

pub   1024R/2719AF35 1995-05-13
uid                  Ben Laurie <ben@thebunker.net>
uid                  Ben Laurie <ben@algroup.co.uk>


请问:
linux内核校验中蓝色的那三行是怎么回事?我从官方下载的这个包是安全的吗?
apache钥匙明明已经导入了,怎么还提示没找到啊?我也导入过官方下载目录中的那个 KEYS 文件,还是不行。是我的校验步骤不对吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP