gpg:对不起,没有终端请求 - 无法获得输入

rog*_*ore 6 architecture linux gnupg snakeyaml public-key-encryption

解密时我收到以下错误:

$ eyaml decrypt -s 'ENC and the key goes on here'
Run Code Online (Sandbox Code Playgroud)
.gnupg --quiet --no-secmem-warning --no-permission-warning --no-tty --yes --decrypt)
failed with: gpg: Sorry, no terminal at all requested - can't get input

我检查了我的钥匙,一切都井然有序.在这一点上,我没有选择.

Jos*_*das 16

如果配置了自动git的承诺与GPG在MacOS签名,你会看到这个错误注释掉no-tty~/.gnupg/gpg.conf 所建议法尔-设计.

在此输入图像描述

这也允许您按照新密钥的GitHub指令生成新的GPG 密钥.


Thr*_*unt 8

对于那些在没有可用 TTY 的情况下运行的脚本中遇到此错误的人,添加--batch到 GPG 命令行或batchin 中的一行~/.gnupg/gpg.conf可以使问题消失。


ode*_*den 5

您需要删除该选项 --no-tty

--no-tty
确保TTY(端子)从不用于任何输出。在某些情况下需要此选项,因为即使使用--batch,GnuPG有时也会向TTY打印警告。

  • 如果其他人用其他gpg命令找到此问题/答案,请检查您的〜/ .gnupg / gpg.conf以进行** no-tty **设置并将其禁用 (2认同)