Linux下使用GPG(GnuPG)加密及解密文件

Linux下使用GPG(GnuPG)加密及解密文件,第1张

GNU Privacy Guard(GnuPG或GPG)是一种加密软件,它是PGP加密软件的满足GPL的替代物。GnuPG依照由IETF订定的OpenPGP技术标准设计。GnuPG用于加密、数字签名及产生非对称钥匙对的软件。

首先安装GPG

sudo apt install gnupg

gpg --gen-key

Real name: 输入用户名

Email address: 输入邮箱

Change (N)ame, (E)mail, or (O)kay/(Q)uit? O

最后查看

gpg --list-keys

这个说明你配置yum时没有gpg

key,一般系统都会有的,在你的linux安装光盘目录下,或者在/etc/pki/rpm-gpg/目录下有一个rpm-gpg-key-redhat-release

在yum.repo文件里最后加入下面一句:

gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release

保存后重新yum

list

all

第一步:创建一个新文件夹,并把光盘的内容全部复制到该文件夹内:[root@localhost ~]# mkdir /yum[root@localhost ~]# cp -rvf /misc/cd/* /yum第二步:安装工具包:[root@localhost ~]# rpm -ivh /yum/Server/createrepo-0.4.11-3.el5.noarch.rpm第三步:生成仓库数据库:[root@localhost ~]# cd /yum[root@localhost yum]# createrepo . //注意后面的.第四步:查看文件:[root@localhost yum]# ls /yum/repodata/filelists.xml.gz other.xml.gz primary.xml.gz repomd.xml第五步:客户端配置:[root@localhost ~]# cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/chenbin.repo[root@localhost ~]# vi /etc/yum.repos.d/chenbin.repo [rhel-chenbin]name=Red Hat Enterprise Linux $releasever - $basearch - Debugbaseurl=file:///yum/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release第六步:清除yum安装时的缓存:[root@localhost ~]# yum clean all


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/7310628.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-04
下一篇2023-04-04

发表评论

登录后才能评论

评论列表(0条)

    保存