On a fresh Ubuntu 16.04 install, I would like to use gpg to cypher my database backups, but I can't have the gpg-agent
working.
postgres@db:~$ gpg -s test.txt
You need a passphrase to unlock the secret key for
user: "Nicolas Remond <[email protected]>"
2048-bit RSA key, ID F5DECA47, created 2016-11-03
gpg: gpg-agent is not available in this session
Enter passphrase:
Also, it seems that a gpg-agent is running as I did the following before:
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
And the gpg config has the use-agent
setting:
postgres@dbmaster0:~$ cat ~/.gnupg/gpg.conf | grep use-agent
# For Ubuntu we now use-agent by default to support more automatic
use-agent
What am I missing ?
--log-file [myfile]
and see if it gives you any errors in the log.gpg: gpg-agent is not available in this session
. If I had a log how you suggest, all I have get is :2016-12-19 13:39:39 gpg-agent[10957] gpg-agent (GnuPG) 2.1.11 started
GPG_AGENT_INFO
, but I don't know how to know what to set ... that's when I got agpg: problem with the agent - disabling agent use
.export GPG_AGENT_INFO=/var/lib/postgresql/.gnupg/S.gpg-agent:0:1
works, but not as a user. Also, it seems that I would have to do that manually, no?