"gpg: decryption failed: No secret key" after export-import to another host

sergio sergio at outerface.net
Thu May 20 12:41:17 CEST 2021


I have generated a key on host A and it works fine:

A $ echo test | gpg --encrypt --recipient <ID> | gpg --decrypt
gpg: encrypted with 256-bit ECDH key, ID <ID>, created <date>
       "Name (comment) <email>"
test

I copied it to host B:

A $ gpg --armor --export <id> > private.key
A $ scp private.key B:
B $ gpg --import private.key

But it doesn't work on B:
B % echo test | gpg --encrypt --recipient <ID> | gpg --decrypt
gpg: encrypted with 256-bit ECDH key, ID <ID>, created <date>
       "name (comment) <email>"
gpg: decryption failed: No secret key


gpg version is the same on both hosts: 2.2.27-2 from debian sid


$ gpg --list-secret-keys --with-subkey-fingerprint
show the same key on both hosts


-- 
sergio.



More information about the Gnupg-users mailing list