gpg signature

本文档详细介绍了如何使用GnuPG为RPM软件包创建并验证数字签名的过程。包括设置GnuPG代理、生成GPG密钥、配置RPM宏文件、重新签署RPM包及检查签名的有效性等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.create a file called /root/.gnupg/S.gpg-agent.

[root@amd-4450b-4-1 ~]# gpg-agent --daemon --use-standard-socket
gpg-agent[26318]: directory `/home/fedora16/.gnupg' created
gpg-agent[26318]: directory `/home/fedora16/.gnupg/private-keys-v1.d' created
GPG_AGENT_INFO=/home/fedora16/.gnupg/S.gpg-agent:26319:1; export GPG_AGENT_INFO;
gpg-agent[26319]: gpg-agent (GnuPG) 2.0.18 started

2.create gpg keys.

[root@amd-4450b-4-1 ~]# gpg --gen-key

3.create rpmmacros file

[root@amd-4450b-4-1 ~]# echo  %_signature pgp>~/.rpmmacros

[root@amd-4450b-4-1 ~]# echo %_gpg_name abcd (redhat)>>~/.rpmmacros

4. resign for rpm

[root@amd-4450b-4-1 ~]# rpm --resign /tmp/var/zsh-4.3.11-2.fc15.x86_64.rpm

5.verify rpm signature

[root@amd-4450b-4-1 ~]# rpm -K /var/zsh-4.3.11-2.fc15.x86_64.rpm
/var/zsh-4.3.11-2.fc15.x86_64.rpm: rsa sha1 (md5) pgp md5 OK

[root@amd-4450b-4-1 ~]# rpm -K /tmp/var/zsh-4.3.11-2.fc15.x86_64.rpm
/tmp/var/zsh-4.3.11-2.fc15.x86_64.rpm: RSA sha1 ((MD5) PGP) md5 NOT OK (MISSING KEYS: (MD5) PGP#44d090c9)


reference  http://hi.baidu.com/boydir/blog/item/076224dd570aa5dd8c1029fd.html


root@user:~# sudo apt install -y curl gpg build-essential Reading package lists... Done Building dependency tree... Done Reading state information... Done build-essential is already the newest version (12.9ubuntu3). curl is already the newest version (7.81.0-1ubuntu1.20). gpg is already the newest version (2.2.27-3ubuntu2.3). gpg set to manually installed. The following packages were automatically installed and are no longer required: bridge-utils containerd pigz ubuntu-fan Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 104 not upgraded. root@user:~# gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 gpg: key 3804BB82D39DC0E3: "Michal Papis (RVM signing) <mpapis@gmail.com>" not changed gpg: Total number processed: 1 gpg: unchanged: 1 root@user:~# curl -sSL https://get.rvm.io | bash -s stable curl: (6) Could not resolve host: api.github.com curl: (6) Could not resolve host: api.github.com curl: (6) Could not resolve host: api.github.com curl: (6) Could not resolve host: api.github.com WARN: ...the preceeding error with code 6 occurred while fetching https://api.github.com/repos/rvm/rvm/tags Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz curl: (7) Failed to connect to github.com port 443 after 6029 ms: Connection refused Could not download 'https://github.com/rvm/rvm/archive/1.29.12.tar.gz'. curl returned status '7'. Downloading https://bitbucket.org/mpapis/rvm/get/1.29.12.tar.gz Downloading https://bitbucket.org/mpapis/rvm/downloads/1.29.12.tar.gz.asc gpg: Signature made Fri 15 Jan 2021 06:46:26 PM UTC gpg: using RSA key 7D2BAF1CF37B13E2069D6956105BD0E739499BDB gpg: Can't check signature: No public key GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.29.12.tgz' - 'https://bitbucket.org/mpapis/rvm/downloads/1.29.12.tar.gz.asc'! Try to install GPG v2 and then fetch the public key: gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB or if it fails: command curl -sSL https://rvm.io/mpapis.asc | gpg --import - command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - In case of further problems with validation please refer to https://rvm.io/rvm/security root@user:~# source /etc/profile.d/rvm.sh -bash: /etc/profile.d/rvm.sh: No such file or directory root@user:~# echo "source /etc/profile.d/rvm.sh" >> ~/.bashrc root@user:~# source /usr/local/rvm/scripts/rvm -bash: /usr/local/rvm/scripts/rvm: No such file or directory root@user:~# echo "source /usr/local/rvm/scripts/rvm" >> ~/.bashrc root@user:~# rvm install 3.1.0 Command 'rvm' not found, but there are 19 similar ones. root@user:~#
最新发布
07-08
啥意思 gxy@gxy:~$ sudo ubuntu-mainline-kernel.sh –i Unknown argument –i Usage: /usr/local/bin/ubuntu-mainline-kernel.sh -c|-l|-r|-u Download & install the latest kernel available from kernel.ubuntu.com Arguments: -c Check if a newer kernel version is available -b [VERSION] Build kernel VERSION locally and then install it (requires git & docker) -i [VERSION] Install kernel VERSION, see -l for list. You don't have to prefix with v. E.g. -i 4.9 is the same as -i v4.9. If version is omitted the latest available version will be installed -l [SEARCH] List locally installed kernel versions. If an argument to this option is supplied it will search for that -r [SEARCH] List available kernel versions. If an argument to this option is supplied it will search for that -u [VERSION] Uninstall the specified kernel version. If version is omitted, a list of max 10 installed kernel versions is displayed --update Update this script by redownloading it from github -h Show this message Optional: -s, --signed Only install signed kernel packages (not implemented) -p, --path DIR The working directory, .deb files will be downloaded into this folder. If omitted, the folder /tmp/ubuntu-mainline-kernel.sh/ is used. Path is relative from $PWD -ll, --low-latency Use the low-latency version of the kernel, only for amd64 & i386 -lpae, --lpae Use the Large Physical Address Extension kernel, only for armhf --snapdragon Use the Snapdragon kernel, only for arm64 -do, --download-only Only download the deb files, do not install them -ns, --no-signature Do not check the gpg signature of the checksums file -nc, --no-checksum Do not check the sha checksums of the .deb files -d, --debug Show debug information, all internal command's echo their output --rc Also include release candidates --yes Assume yes on all questions (use with caution!) gxy@gxy:~$
07-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值