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

Erich Eckner gnupg at eckner.net
Thu May 20 14:11:37 CEST 2021


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

have a look at the manpage at --export-secret-keys:

"Same as --export, but exports the secret keys instead. ..."

regards,
Erich

On Thu, 20 May 2021, sergio via Gnupg-users wrote:

> 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.
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE3p92iMrPBP64GmxZCu7JB1Xae1oFAmCmUfwACgkQCu7JB1Xa
e1oSqg/9EepKvPziEfCmyDFe/4DIfkilsYWGqIOmXuKZyyykxXqBegyxAgZ8p3BK
aqkzq/lS9IgB0AiyZ9whFRH1q9rVXfZwmfxjN4eEkz4dkrNaPSGk9OlWC2l4ZM1n
Nxld2teVd6zbXFZiOCWXqpgLTj9tzY1Jv3bKyYa03NmIzTS3aI5nd9ES9je/veiO
+t9Ytii18nsNApj8VgFqT4Q/5Ie3hu2VYHcCx/tdjNe+biZsEUAmPl1hY4Z/Rhko
e5q8WRJzybnaPBX0llWkZ6G6cYHxAlIytmLjlSWAsLbCbd0/WwOQcdwqlBLM9sUg
dq1EE5FXJNlqwhZ+xzYqSvmYfrS0Hzp+j4FCBiM8I1g0aWQzfGD5RDD2SLm1JD8z
5pjs9dfAv0IwlXjoZ5t3cflqHp0Q+BUXgJigGIwNs9LYwsdreNEv2FqA0Rc0gW3j
F6MsfI4hfeLAY/cwr5LyDB/UOjl5p4i83Z8DmVbQYZfhnuhAwq07yHcXIae9iy3s
taNpurM+4QJchtq7Xs+MgyvZtATb9Kc1XduAgQ1U50Lepm5ppS4orh13d8qyk8P0
um2J+MpvxJILIlHxBPwF7cLYA/N++4+9FlOlHNH/S9SPyYBFaa4OviKCPoWrNr7L
3r9dMdiF89CCYF8frRF/qW0+weBPR+ePTwa9cRXm81innUQHeZM=
=uft7
-----END PGP SIGNATURE-----



More information about the Gnupg-users mailing list