ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 公钥私钥加解密

公钥私钥加解密

原创 Linux操作系统 作者:bjiokn 时间:2009-11-27 18:34:15 0 删除 编辑

机器A:
机器B:

A:# useradd bofeng
  # passed bofeng  --->>redhat
  # su - bofeng
  # gpg --gen-key
    1 -- 1024 -- 0 -- y -- bobbob -- bob@bob.com -- redhatbob -- O -- xxxxx

B:# useradd alice
  # passwd alice   --->>redhat
  # su - alice
  # gpg --gen-key
    1 -- 1024 -- 0 -- y -- alice -- alice@alice.com -- redhatalice -- O -- xxxxx

A:
  # gpg --import /tmp/alice.pubkey  (导入alice的公钥)
  # vim mail.txt
    xxxxxxxx
  # gpg -sea mail.txt  (会声称一个mail.txt.asc 的文件,将该文件拷给alice用户)
 
B:
  # gpg mail.txt.asc (验证文件签名,会生成一个mail.txt文件)
  # cat mail.txt


《完》

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21021875/viewspace-620872/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 创建逻辑卷
请登录后发表评论 登录
全部评论

注册时间:2009-05-31

  • 博文量
    94
  • 访问量
    113659