I don't know much about how yubikeys work, but I'm trying to sign a commit with one of them and I don't even know how to debug the problem. I got:

gpg --list-keys
pub   ed25519 2018-11-30 [SC]
uid           [ unknown] [email protected]
sub   cv25519 2018-11-30 [E]


git commit -m "hdle" -S 
error: gpg failed to sign the data
fatal: failed to write commit object


gpg --status-fd=2 -bsau 'MyName <[email protected]>'
gpg: skipped "MyName <[email protected]>": No secret key
[GNUPG:] INV_SGNR 9 MyName <[email protected]>
[GNUPG:] FAILURE sign 17
gpg: signing failed: No secret key

PS: SSH login works with yubikey


echo "test" | gpg --clearsign
gpg: no default secret key: No secret key
gpg: [stdin]: clear-sign failed: No secret key
  • I find it easier to troubleshoot by first trying to sign a generic message (rather than a commit) first, using echo "test" | gpg --clearsign. Commented Jun 2, 2022 at 1:57
  • @keithRozario added an update
    – Rafaelo
    Commented Jun 2, 2022 at 11:33
  • What do you get with "gpg --list-secret-keys"? Commented Jun 2, 2022 at 12:34
  • @thenickdude empty response
    – Rafaelo
    Commented Jun 2, 2022 at 17:39
  • @thenickdude how can I do SSH if I have no secret keys?
    – Rafaelo
    Commented Jun 2, 2022 at 17:40


You must log in to answer this question.

Browse other questions tagged .