我有以下脚本:
#!/bin/sh -e
PWD="supersecretpassword"
file="/backup/2do/example.txt"
echo before
echo $PWD | gpg --passphrase-fd 0 -c $file
echo after
Run Code Online (Sandbox Code Playgroud)
如果手动执行,这些脚本工作得很好,但是当作为 crontab 执行时,当 gpg 行被执行时就会停止工作。
GPG 显示:
gpg: cannot open `/dev/tty': No such device or address
Run Code Online (Sandbox Code Playgroud)
我很感激任何建议!
解决方案:添加--no-tty到 GPG
我将 ssh 配置为使用 GPG 作为我的 ssh 代理,如果我删除了该~/.ssh文件夹,我可以使用我的 gpg 密钥通过 ssh 进入我的服务器。但是,我的~/.ssh文件夹中有十多个不同的 ssh 密钥,如果我在它存在时尝试 ssh,我会收到权限被拒绝错误,因为我的 ssh 客户端在尝试密钥之前提供了目录中的每个私钥gpg SSH 代理。
使用常规 ssh 密钥,我只使用文件中的IdentityFile配置~/.ssh/config,但我不能这样做,因为我的身份是 gpg cardno。我很困惑为什么 ssh 更喜欢密钥文件而不是代理。有没有办法强制 ssh 使用代理而不是文件?或者更好的是,有没有办法在~/.ssh/config文件中指定gpg 密钥必须用于给定服务器?
我已经确认ssh-agent没有运行并且gpg-agent正在运行并ssh-add -L显示我的 gpg 密钥存在,以及一个其他 ssh 样式的私钥。
我试图围绕公钥密码术如何真正以安全的方式工作。
据我所知,您可以访问 example.com 并下载他们的 PGP/GPG 公钥并将其添加到您的密钥环中。然后他们向您发送一个用他们的私钥签名或用您的公钥加密的文本文件(或诸如此类);您可以验证其真实性和/或解密它。
如果攻击者修改了传输给您的网站并以他们的名义签署了他们自己的假密钥,然后您将其放入您的密钥环中怎么办?然后您继续验证和解密被篡改的文件,假设它是有效的。
我假设我在谈论中间人对整个网络流量的篡改,或类似的事情。我只是不确定“签名”如何防止密钥和数据在传输过程中被伪造。
我搜索了高低,试图找到一种方法,允许我在 OpenLDAP 服务器中为现有用户存储 GPG 密钥。我发现的唯一相关操作方法是this。但是,我无法让这种方法与现有的 OpenLDAP 数据库一起使用。我已成功导入架构,但我无法弄清楚如何将信息实际添加到架构中指定的字段。
如果我可以提供任何其他信息,请告诉我。
有没有办法删除或替换 RPM 上现有的 GPG 签名?
我将一些晦涩的 RPM 放在我们用于补充 rhel/centos 包的内部存储库中。其中一些 RPM 已经签署。我想删除这些签名并使用我们用于本地存储库的 GPG 签名重新签名。
我有一台在 Debian Wheezy 上运行的服务器。
它的 apt 源文件具有以下配置:
deb http://ftp.uk.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.uk.debian.org/debian/ wheezy main non-free contrib
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
# wheezy-updates, previously known as 'volatile'
deb http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free
Run Code Online (Sandbox Code Playgroud)
当我尝试更新时,我收到官方 Debian 存储库的 GPG 错误:
root@osgb:~# apt-get clean
root@osgb:~# apt-get update
Get:1 http://security.debian.org wheezy/updates Release.gpg
Get:2 http://ftp.uk.debian.org wheezy Release.gpg
Get:3 http://ftp.uk.debian.org wheezy-updates Release.gpg
Get:4 http://security.debian.org wheezy/updates Release
Ign http://security.debian.org wheezy/updates Release …Run Code Online (Sandbox Code Playgroud) 我已经使用 RSA 和 RSA 算法成功创建了 GnuPG 公钥/私钥对。如何以带有.asc扩展名的文件形式导出公钥和私钥?
我们使用 DigitalOcean 作为我们的 VPS 提供商。他们有一个关于如何为加密备份设置 Duplicity的教程,但它不包括数据库备份或 Google Drive 端点。
我在网上找到了一些关于 Duplicity 和 Google Drive 的其他教程,但它们似乎都不完整或过时。
我正在为一些自定义 Raspberry Pi 代码托管一个私有 Debian 存储库。我最初在 Raspbian Jessie(版本 8)上构建了该软件,生成了一个 GPG 密钥,我用它来签署存储库,并sudo apt-key add ...在所有设备上运行,以确保他们能够验证我的存储库。这工作正常,直到最近我添加了一些运行 Raspbian Stretch(版本 9)的新设备。即使我向它们添加了完全相同的 GPG 密钥,以下是我运行时看到的输出sudo apt-get update:
W: GPG error: http://url.of.private.repo stable Release: The following signatures were invalid: 95F9B44CE35F40B759D59C2A77E4184C595493B1
W: The repository 'http://url.of.private.repo stable Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Run Code Online (Sandbox Code Playgroud)
但是,这只发生在较新的盒子上。在仍在运行 Jessie 的 Pis 上,我可以运行sudo apt-get …
在 Ubuntu 20.04 LTS 上,我正在尝试安装 MongoDB、Sublime Text 3 等软件包,但在添加它们之前,必须添加它们的 repo url。我正在尝试这个命令:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
它失败了这条消息:
gpg: invalid key resource URL '/tmp/apt-key-gpghome.Mi0IvTayBR/home:hawkeye116477:waterfox.asc.gpg'
gpg: keyblock resource '(null)': General error
gpg: key 7721F63BD38B4796: 2 signatures not checked due to missing keys
gpg: key 5E62D791625A271E: 1 signature not checked due to a missing key
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key …Run Code Online (Sandbox Code Playgroud) gpg ×10
apt ×2
debian ×2
pgp ×2
public-key ×2
repository ×2
backup ×1
centos ×1
cron ×1
cryptography ×1
duplicity ×1
google-drive ×1
mysql ×1
openldap ×1
private-key ×1
raspbian ×1
rpm ×1
rsa ×1
ssh ×1
ssh-agent ×1
terminal ×1
ubuntu ×1