GPG 需要哪些环境变量?

GPG 需要哪些环境变量?

我正在尝试设置 docker 凭证,它需要先初始化gpg

以下是我的步骤:

root@remote_machine:~# gpg --gen-key                                                                   
gpg (GnuPG) 2.2.4; Copyright (C) 2017 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Note: Use "gpg --full-generate-key" for a full featured key generation dialog.

GnuPG needs to construct a user ID to identify your key.

Real name: NeededUser
Email address: [email protected]
You selected this USER-ID:
    "NeededUser <[email protected]>"

Change (N)ame, (E)mail, or (O)kay/(Q)uit? O
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: agent_genkey failed: Required environment variable not set
Key generation failed: Required environment variable not set
root@remote_machine:~# 

我尝试设置 GPG_TTY 变量,结果设置为/dev/pts/0。GPG 需要哪些变量?

答案1

我使用 kitty 作为终端模拟器。切换到 konsole 后,问题就解决了

答案2

使用 kitty 作为终端仿真器时遇到了同样的问题,通过 ssh。使用 xterm 解决了我的问题。问题是,在配置结束时,gpg 会在 kitty 可能不支持通过 ssh 的窗口中要求输入密码。

xterm gpg 窗口

相关内容