机器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/
,如需转载,请注明出处,否则将追究法律责任。