使用gpg中遇到problem with the agent: No pinentry

新安装的最小化centos8系统在gpg对称加密文档时,使用中遇到如下问题:

[root@centos ~]# gpg -c test 
gpg: problem with the agent: No pinentry
gpg: error creating passphrase: Operation cancelled
gpg: symmetric encryption of 'test' failed: Operation cancelled

网上查看参考资料,有推荐使用uset DISPLAY,尝试了一下还是不行。
前辈们的方案提供我了一个思路。
我拿centos7和centos8系统进行了比较:

centos7使用gpg会自动创建一下目录

[oot@centos7 ~ ]#rpm -qf `which gpg`
gnupg2-2.0.22-5.el7_5.x86_64

[root@centos7 ~ ]#ll ~/.gnupg/
total 12
-rw-------. 1 root root 7680 Dec  5 23:57 gpg.conf
drwx------. 2 root root    6 Dec  5 23:57 private-keys-v1.d
-rw-------. 1 root root    0 Dec  5 23:57 pubring.gpg
-rw-------. 1 root root  600 Dec  5 23:57 random_seed
srwxr-xr-x. 1 root root    0 Dec  5 23:57 S.gpg-agent

centos8使用gpg会自动创建一下目录

[root@centos8 ~ ]#rpm -qf `which gpg`
gnupg2-2.2.9-1.el8.x86_64
[root@centos8 ~ ]#ll ~/.gnupg/
total 8
drwx------. 2 root root   6 Dec  5 22:34 private-keys-v1.d
-rw-------. 1 root root  32 Dec  5 22:34 pubring.kbx
-rw-------. 1 root root 600 Dec  5 23:18 random_seed

拿能正常打开窗口的Centos8对比

正常:
[root@centos8 ~ ]#ls /usr/bin/ | grep pinentry
pinentry
pinentry-curses          
[root@centos8 ~ ]#which pinentry
/usr/bin/pinentry
[root@centos8 ~ ]#rpm -qf `which pinentry`
pinentry-1.1.0-2.el8.x86_64
有问题的
[root@centos ~]# ls /usr/bin/ | grep pinentry
[root@centos ~]# rpm -q pinentry-1.1.0-2.el8.x86_64
package pinentry-1.1.0-2.el8.x86_64 is not installed
[root@centos ~]# yum install pinentry -y

安装pinentry包文件后恢复。

参考链接:
https://qastack.cn/superuser/520980/how-to-force-gpg-to-use-console-mode-pinentry-to-prompt-for-passwords

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值