-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gpg: decryption failed: No secret key #328
Comments
This indicates that you don't have the secret key of |
@smlx By the way, what I actually want to do is sign commits, for which I get the same error as above. The only thing that works in SSH. What should I do? |
I don't know if this will help but these are the notes I made of the steps to follow on a new Linux system:
|
@Paraphraser what if I only have the public key, not the key id? Anyways
so I guess I have the key id. But I already did all of this process :( and SSH works |
there's just the |
In my earlier reply, I hope I didn't give you the impression I was any kind of expert on this stuff. I'm not (0.5 on a 10-point scale if I'm feeling generous). My general approach is to keep belting the problem with whatever digital hammer is within reach and only stop thwacking stuff when the thing I'm trying to achieve seems to work. I won't say I followed the DrDuh guide exactly when I set up my own YubiKeys in late 2019 but the notes I made at the time show my process was reasonably close to what the guide says now. Here are the patterns I see on my own systems:
I interpret that as:
So, let's put a pin in that and examine your pattern:
I interpret that as:
Quite different - agreed? The question I ask myself is, "can I replicate that?" After a few false starts, it turns out the answer is yes. Setup steps (Raspbian):
Generate "ECC and ECC" with "Curve 25519":
Pattern analysis:
Pretty much identical pattern to yours - agreed? So, the first issue would seem to be to figure out why, if we both followed the DrDuh guide, I wound up with RSA with C plus S+E+A split over sub-keys, while you have elliptic curve with S+C plus a single E sub-key. One possibility is, assuming your "2018-11-30" is true, you were working a year ahead of me so maybe the guide was different then? Another possibility. I have another key-pair which is analogous to your pattern:
Those are from Keybase. RSA but the SC plus E is the same as yours. I generated and exported those, and then used them to sign the master key I was generating for the YubiKey. Why? For no better reason than that it seemed like a good idea at the time. Perhaps you did something similar? While the steps I outlined in my earlier reply let me get going on a new machine given only my public keys plus the YubiKey, any time I want to do something more serious, I need to go back to the snapshot of the master-key generation just before the private keys were transferred to the YubiKey. That's Backup in the DrDuh guide. I'm afraid that I didn't go to quite the extremes in the guide:
Anyway, given this backup, I can restore to the moment before the private keys were transferred to the YubiKey. That means I can edit whatever needs to be edited and then repeat the basic process of:
Unless you skipped the "make a backup" step or have since lost the backup, you should be able to do the same. The last possibility is that you see if Recovering lost GPG public keys from your YubiKey solves your problem. I have not tried it so I have no idea whether it works - please remember to report back here if it does. If none of this helps you have an "ahah" moment, you might have to start from scratch and generate all-new keys. |
Please reopen if there's still an issue to discuss. |
I have had similar problems, found this by web searching, and wrote up a few things I learnt to fix it (for me) on https://github.com/vorburger/vorburger-dotfiles-bin-etc/blob/main/docs/yubikey.md#troubleshooting; perhaps this will be useful for others stumbling over this in the future. |
After importing my key to another PC:
I have no idea what is going on.
PS: ssh with public key works
The text was updated successfully, but these errors were encountered: