Hol*_*gen 5 apt gnupg reprepro
在我的仿生“客户”上,我得到:
GPG error: http://repo.localpod/Dml/ldom-debs/ubuntu bionic InRelease: The following signatures were invalid: ADE541A20ACF8997C01BDCF7090678A30132048A
Run Code Online (Sandbox Code Playgroud)
请注意,它说“无效”,而不是遗漏!
这些是我自己的 .deb 包,收集在一个 repo 中。(这适用于 trusty & xenial )
我已经用类似的东西签署了回购协议:(通过 reprepro 调用:conf/distributions)
gpg --batch --yes --keyring $KeyP --secret-keyring $KeyS -a --no-permission-warning --detach-sign --default-key 'ldom install service' --output $3 $1
$1 = .../Release
$2 = .../InRelease
Run Code Online (Sandbox Code Playgroud)
好的,所以我试过:
wget http://repo.localpod/Dml/ldom-debs/ubuntu/dists/bionic/InRelease
and:
# gpgv --keyring /etc/apt/trusted.gpg "InRelease"
gpgv: Signature made Thu 24 May 2018 12:20:29 PM CEST
gpgv: using DSA key 090678A30132048A
gpgv: Good signature from "ldom install service <tbuunix@...dk>"
Run Code Online (Sandbox Code Playgroud)
这不是或多或少是 apt-get 检查签名的方式吗?还是钥匙太旧了?类型不对?
完整错误:
apt-key list
pub rsa2048 2014-06-24 [SC]
754A 1A7A E731 F165 D5E6 D4BD 0E08 A149 DE57 BFBE
uid [ unknown] SaltStack Packaging Team <packaging@saltstack.com>
sub rsa2048 2014-06-24 [E]
pub dsa1024 2013-06-10 [SCA]
ADE5 41A2 0ACF 8997 C01B DCF7 0906 78A3 0132 048A
uid [ unknown] LDOM install service <tbuunix@....dk>
sub elg1024 2013-06-10 [E]
root@ubu18:~# apt-get update
Get:1 http://repo.localpod/Dml/ldom-debs/ubuntu bionic InRelease [1,154 B]
Err:1 http://repo.localpod/Dml/ldom-debs/ubuntu bionic InRelease
The following signatures were invalid: ADE541A20ACF8997C01BDCF7090678A30132048A
Reading package lists... Done
W: GPG error: http://repo.localpod/Dml/ldom-debs/ubuntu bionic InRelease: The following signatures were invalid: ADE541A20ACF8997C01BDCF7090678A30132048A
E: The repository 'http://repo.localpod/Dml/ldom-debs/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Run Code Online (Sandbox Code Playgroud)
关于我失踪的任何线索,欢迎......谢谢,
/霍尔格
我结束了以下指导(https://www.digitalocean.com/community/tutorials/how-to-use-reprepro-for-a-secure-package-repository-on-ubuntu-14-04)--- -> 或多或少。---> 仍然有点“正在进行中”,但这里有一些提示:
使用(新鲜)泊坞窗图像:
docker run -it -v /your/packages:/debs ubuntu:18.04
apt update
apt install -y vim inetutils-ping curl wget netcat telnet aptitude man manpages bash-completion rng-tools reprepro iproute2
rebuild your packages:
cd /debs/src
ls -d */DEBIAN | xargs -n1 dirname | xargs -n1 dpkg-deb -vD --build
Run Code Online (Sandbox Code Playgroud)
关键的东西的时间。使用现有密钥:
gpg --import /debs/.../secring.gpg
Run Code Online (Sandbox Code Playgroud)
对于新密钥:
gpg --full-generate-key
#rsa 4
#bits 4096
#your_key_name
#passphrase
#
gpg --edit-key your_key_name
#addkey
#(4) RSA (sign only)
#4096
#0
#yes
#yes
#save
gpg --list-secret
gpg --list-key
gpg --export .....your..key.....number............... > keyfile
apt-key add keyfile
Run Code Online (Sandbox Code Playgroud)
好的,是时候进行 reprepro 设置了:
mkdir /debs/u18repo
cd /debs/u18repo
cat <<END >conf/options
ask-passphrase
END
cat <<END >conf/distributions
Codename: bionic
Components: main
Architectures: amd64
SignWith: .....your..key.....number...............
END
reprepro -b /debs/u18repo includedeb bionic /debs/src/*.deb
gpg --export .....your..key.....number............... > keyfile
Run Code Online (Sandbox Code Playgroud)
去测试:
apt-key add keyfile
echo "deb file:////debs/u18repo/ bionic main" >> "/etc/apt/sources.list"
apt update
Run Code Online (Sandbox Code Playgroud)
现在,如果您在客户端 ( httpd ) 上共享 /debs/u18repo,并使用以下命令导入密钥: apt-key add http:/.../keyfile apt update 应该可以工作...
我遇到过同样的问题。在 InRelease 文件中有 PGP 签名的消息,它应该包含:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Run Code Online (Sandbox Code Playgroud)
这意味着 SHA256 用于签名。SHA1 是弱算法,不应使用。所以如果有 SHA1 你需要更新你的 gnupg 配置来使用 sha256
就我而言:
echo "personal-digest-preferences SHA256 SHA384 SHA512 SHA224 RIPEMD160" >> ~/.gnupg/gpg.conf
然后像往常一样使用 gpg 退出 InRelease 文件。
| 归档时间: |
|
| 查看次数: |
2574 次 |
| 最近记录: |