在全新安装的Ubuntu 16.04上,我想使用gpg来加密数据库备份,但是我无法gpg-agent
正常工作。
postgres@db:~$ gpg -s test.txt
You need a passphrase to unlock the secret key for
user: "Nicolas Remond <nicolas@xxx.com>"
2048-bit RSA key, ID F5DECA47, created 2016-11-03
gpg: gpg-agent is not available in this session
Enter passphrase:
另外,似乎gpg-agent正在像我之前做的那样运行:
postgres@db:~$ gpg-agent
gpg-agent[1715]: no gpg-agent running in this session
postgres@db:~$ gpg-connect-agent /bye
gpg-connect-agent: no running gpg-agent - starting '/usr/bin/gpg-agent'
gpg-connect-agent: waiting for the agent to come up ... (5s)
gpg-connect-agent: connection to agent established
postgres@db:~$ pidof gpg-agent
1762
并且gpg config具有以下use-agent
设置:
postgres@dbmaster0:~$ cat ~/.gnupg/gpg.conf | grep use-agent
# For Ubuntu we now use-agent by default to support more automatic
use-agent
我想念什么?
我收到的正确错误消息是
—
n1r3
gpg: gpg-agent is not available in this session
。如果我有日志,您的建议是,我得到的是:2016-12-19 13:39:39 gpg-agent[10957] gpg-agent (GnuPG) 2.1.11 started
我尝试手动设置
—
n1r3
GPG_AGENT_INFO
,但我不知道如何知道要设置的内容……那是我得到的gpg: problem with the agent - disabling agent use
。
作为超级用户,设置
—
n1r3
export GPG_AGENT_INFO=/var/lib/postgresql/.gnupg/S.gpg-agent:0:1
有效,但不能作为用户使用。另外,似乎我必须手动执行该操作,不是吗?
是否已按照_man gpg-agent页面中所述将此GPG_TTY = $(tty)导出GPG_TTY导出到您的.bashrc文件中?
—
乔治·乌德森
--log-file [myfile]
然后查看日志中是否给您任何错误。