gpg --gen-key 在“su -l”上不起作用,但在本地终端上起作用

gpg --gen-key 在“su -l”上不起作用,但在本地终端上起作用

当我尝试以我刚刚创建的用户(“backtest”)使用“gpg --gen-key”(archlinux 上的 v2.1.2)时,当我为其打开终端时它可以工作,但是当我以另一个用户身份登录然后“su -l backtest”时则不行。

这就是我正在做的:

[backtest@server ~]$ echo "pinentry-program /usr/bin/pinentry-curses" >.gnupg/gpg-agent.conf 
[backtest@server ~]$ echo RELOADAGENT | gpg-connect-agent
OK
[backtest@server ~]$ GPG_TTY=`tty` gpg --gen-keygpg

这就是我得到的:

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: Operation cancelled
Key generation failed: Operation cancelled

相关内容