gpg not able to find my secret key

Martin T m4rtntns at
Thu Aug 23 11:54:57 CEST 2018


I reinstalled my workstation and moved ~/.gnupg directory from old
machine to new one. Gpg version in both workstations is 2.1.18. The
problem is, that in the new workstation, when I try to decrypt a file,
it doesn't find the secret key:

$ gpg -o .file -d .file.gpg
gpg: encrypted with RSA key, ID 7BA1DFF9E00DF644
gpg: decryption failed: No secret key

When I list the secret keys(gpg --list-secret-keys), then the output
is empty. When I start the "gpg --list-secret-keys" with "strace -e
open", then ~/.gnupg/secring.gpg file is not searched. gpg-agent is
not running. When I start the gpg-agent, then it does't change
anything, i.e the "gpg --list-secret-keys" is empty.
Directory and file permissions for ~/.gnupg are the same as in old
installation. I also started both gpg and gpg-agent with
"--debug-level guru" option, but it provided no useful information.
For example:

$ gpg --debug-level guru --list-secret-keys
gpg: enabled debug flags: packet mpi crypto filter iobuf memory cache
memstat trust hashing ipc clock lookup extprog
gpg: DBG: [not enabled in the source] start
gpg: DBG: [not enabled in the source] keydb_new
gpg: DBG: [not enabled in the source] keydb_search_reset
gpg: DBG: keydb_search: reset  (hd=0x000055e6f13ce8b0)
gpg: DBG: [not enabled in the source] keydb_search enter
gpg: DBG: keydb_search: 1 search descriptions:
gpg: DBG: keydb_search   0: FIRST
gpg: DBG: keydb_search: searching keybox (resource 0 of 1)
gpg: DBG: keydb_search: searched keybox (resource 0 of 1) => EOF
gpg: DBG: [not enabled in the source] keydb_search leave (not found)
gpg: DBG: [not enabled in the source] stop
gpg: random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
              outmix=0 getlvl1=0/0 getlvl2=0/0
gpg: secmem usage: 0/65536 bytes in 0 blocks

What might cause this?


More information about the Gnupg-users mailing list