首页 > 其他 > 详细

gpg非对称密钥

时间:2020-09-06 09:01:34      阅读:120      评论:0      收藏:0      [点我收藏+]
实验环境:
centos6-1
centos6-2

#####################
centos6-1创建密钥对:gpg --gen-key
(可以不给密钥加密)时间会比较久
查看密钥对:gpg -list-keys
导出公钥到:jack.pubkey
gpg -a --export -o jack.pubkey

将公钥发送给centos6-2:
rsync -a jack.pubkey centos6-2:/root/.ssh/

########################################
centos6-2创建密钥对:gpg --gen-key
导入centos6-1的公钥:gpg --import jack.pubkey
查看密钥列表: gpg --list-keys
用centos6-1的公钥对文件加密:gpg -e -r jack test.txt
会生成:test.txt.gpg

将加密文件发送给centos6-1:rsync -a test.txt.gpg centos6:/root/
####################################################

解密文件并输出:gpg -d test.txt.gpg -o test.txt
###################################################

gpg非对称密钥

原文:https://blog.51cto.com/13434656/2529032

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!