How to deal with Gnupg error: gpg: no default secret key: No secret key gpg: [stdin]: clearsign failed: No secret key?

Cindrella picture Cindrella · Jun 1, 2012 · Viewed 16.2k times · Source

I am getting an error:

gpg: no default secret key: No secret key
gpg: [stdin]: clearsign failed: No secret key

My secret keys are available to GPG.

Answer

Ding-Yi Chen picture Ding-Yi Chen · Aug 29, 2017

It might be difference between gpg1 and gpg2. The secret keys are stored in different ways. You may have both of them.

Try

which gpg gpg2

If you do have both, run:

gpg2 --list-secret
gpg --list-secret

You maybe able to tell that one works, another does not.