- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在为 Web 开发设置新机器 (macOS Sierra),我已经完成 brew install gpg
安装了 gpg2
和 gpg-agent
。我已经从旧 Mac 上的 ~.gnupg
复制了我的 key 。我不安装我在旧机器上安装的 mac 界面 GPG 套件,因为我真的更愿意只使用命令行。
我已经使用适当的设置设置了我的 git 全局变量。
git config --global user.name "Christopher Allen"
git config --global user.email "ChristopherA@LifeWithAlacrity.com"
git config --global user.mail "ChristopherA@LifeWithAlacrity.com"
git config --global user.signingKey F8D36C91357405ED
当我尝试将更改提交到需要 git config commit.gpgsign=true
的 git 存储库时,在我的旧 GPG Suite 上,我会看到一个 pop 窗口,要求我输入密码。但是,仅使用 GPG,它确实可以正确找到我的公钥,但不会提示我输入密码进行签名。
$ git commit -S -m "changed code"
You need a passphrase to unlock the secret key for
user: "Christopher Allen <ChristopherA@LifeWithAlacrity.com>"
4096-bit RSA key, ID 357405ED, created 2015-04-16
error: gpg failed to sign the data
fatal: failed to write commit object
$
在这里进行研究,我唯一看到的提及是“I can’t get `git tag -s` to ask for my GPG password”,它表明问题出在 gpg-agent
的环境变量(没有建议的解决方案),或者使用 gpg -preset-passphrase 函数(我不想这样做)。
进一步检查,gpg-agent
似乎没有运行:
$ gpg-agent
gpg-agent: no gpg-agent running in this session
我找到了这个页面 https://blog.chendry.org/2015/03/13/starting-gpg-agent-in-osx.html建议将此脚本添加到 .bash_profile:
[ -f ~/.gpg-agent-info ] && source ~/.gpg-agent-info
if [ -S "${GPG_AGENT_INFO%%:*}" ]; then
export GPG_AGENT_INFO
else
eval $( gpg-agent --daemon --write-env-file ~/.gpg-agent-info )
fi
获取此脚本后,gpg-agent
说:
$ gpg-agent
gpg-agent: gpg-agent running and available
但是,我还是遇到了同样的问题。
关于如何解决这个问题的任何想法?我不想使用旧的 GPG 套件,恢复到 GPG 1.0,或者使用 gpg-preset-passphrase。
谢谢!
-- 克里斯托弗·艾伦
最佳答案
我实际为解决这个问题所做的是:
brew install pinentry
如果那还不行,那么:
export GPG_TTY=$(tty)
这实际上为我解决了问题。
您还可以将此导出添加到您的 ~/.bashrc
以便它自动导出不要忘记重新加载文件或启动新 session 。
一个简单的方法:echo "export GPG_TTY=$(tty)">> ~/.bashrc
如果出现此错误:
gpg-agent: 没有 gpg-agent 在这个 session 中运行
将问题中提到的脚本添加到 ~/.bashrc
文件中。
[ -f ~/.gpg-agent-info ] && source ~/.gpg-agent-info
if [ -S "${GPG_AGENT_INFO%%:*}" ]; then
export GPG_AGENT_INFO
else
eval $( gpg-agent --daemon --write-env-file ~/.gpg-agent-info )
fi
回声“你好” | gpg -s
当 git 不要求我输入密码时,有时我会使用上面的测试命令来获得提示,这将被缓存,然后我尝试提交我的更改。
如果您想将密码缓存更长的时间,您可以将以下行添加到配置文件中:~/.gnupg/gpg-agent.conf
default-cache-ttl 86400
关于git - `git -S -m commit` 请求密码失败 — 从 GPG mac 移动到 GPG shell 后签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39669830/
(kubuntu,但在我的方法中试图保持平台独立。) 概念解释或必要步骤都值得赞赏。 我正在阅读文档,并试图获取 gpg-agent工作一次,但我感到气馁,因为每次尝试都需要重新启动,而且我并不真正理
记录遇到的问题; 在aliyun上安装MySQL时由于上次错误卸载mysql 导致校验文件出问题; 处理方式有几种 1到mysql官网下载校验文件 2跳过校验,记录第二种 编
我想为一个 atm 创建一个自动 GnuPG key 生成脚本,尽管他们运行 ubuntu,但不习惯使用 CLI。此外,其他人管理他们的计算机,使其保持最新状态并处于良好的运行状态,因此他们也没有 r
我刚刚不小心丢失了旧的 gpg key 。我想知道我是否可以删除每个提交的 gpg 标志或使用我的新 gpg key 重新签名? 最佳答案 我知道这是一个老问题,但我遇到了类似的情况,我不得不签署(实
作为 perl 脚本的一部分,我根据从电子邮件中获得的周期数从网站下载一些文件。我使用正则表达式找到合适的周期数,将其附加到 url 并从所述 url 获取加密文件。然后我将加密文件打印到临时文件,并
查看Subj:如何在不使用本地存储(在〜/.gpg下)的情况下从gpg中的私有(private)获取公钥? 此解决方案不满足要求: $ gpg --import priv.key $ gpg --ex
我有 1 个 github 用户和另一个 gitlab 用户,我为每个用户创建了 1 个 gpg key ,因为我的电子邮件地址不同。 问题是我必须执行 git config --global use
我在运行这段代码时遇到了这个错误。 gpg --fingerprint gpg: WARNING: unsafe ownership on configuration file `/home/dyla
我遵循本教程:https://help.github.com/articles/signing-commits-using-gpg/ 我尝试像这样提交时签名: https://github.com/s
我从 brew 安装了 GPG。 brew install gpg 它是 gnupg2-2.0.30_2。 当我提交时,我确实收到一条错误消息: You need a passphrase to un
在我添加 docker GPG key 时设置 docker 存储库 cmd- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | su
我全新安装了 Linux Mint 14。安装了 Thunderbird 和 Enigmail。 生成我的 key ,得到一个 friend 的公钥,导入它。 给我的 friend 发了一封加密的电子
我是 Unix 和 ksh 脚本编写的新手。我写了一个解密 gpg 消息的脚本。我收到此错误,我不知道如何解决。我希望有人可以查看我的脚本并帮助我弄清楚发生了什么。感谢您提供的任何帮助。 这是错误:
我正在尝试在我的 ubuntu 机器上安装 chirpstack。尝试设置 key 时出现以下错误。 jonny@jonny-ubuntu:~$ sudo gpg --keyserver keyser
我正在为 Web 开发设置新机器 (macOS Sierra),我已经完成 brew install gpg 安装了 gpg2 和 gpg-agent。我已经从旧 Mac 上的 ~.gnupg 复制了
我正在使用以下命令 gpg --keyserver hkp://pool.sks-keyservers.net --send-keys 按照本文的指导https://getstream.io/blo
尝试将我们的基本镜像迁移到稳定的 Ubuntu 18.04,当我们尝试添加我们的 gpg key 时,出现此错误: root@77ff14f29cab:/# apt-key add apt-key.g
我运行的是GitHub工作流,过去我曾多次使用该工作流将代码发布到Nexus.它现在正在失败。我已经有一段时间没有使用它了,所以我的原始密钥可能已经过期了……自从我创建它以来,已经超过3年了,我不记得
我收到一个错误: gpg: no default secret key: No secret key gpg: [stdin]: clearsign failed: No secret key GPG
如何在 Scala 中解密 OpenPGP 加密文件?我有公钥和私钥,并且 gpg --output file.txt --decrypt file.txt.gpg 有效。 最佳答案 从 PR 到 h
我是一名优秀的程序员,十分优秀!