-
Notifications
You must be signed in to change notification settings - Fork 26
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
How do I unblock my key after several failed generate attempts? #148
Comments
I'm pretty sure this has happened to me at least once before, on a 4c nano - and I managed to recover from it? But I made no notes nor public bug reports that I can find, so .. help /: |
And just like that, I remembered: You use the yubikey-manager, and with that, reset the PIV app: :; ykman piv info
PIV version: 5.4.3
PIN tries remaining: 0/3
Management key algorithm: 3
WARNING: Using default PIN!
WARNING: Using default Management key!
CHUID: No data available
CCC: No data available
:; ykman piv reset
WARNING! This will delete all stored PIV data and restore factory settings. Proceed? [y/N]: y
Resetting PIV data...
Success! All PIV data have been cleared from the YubiKey.
Your YubiKey now has the default PIN, PUK and Management Key:
PIN: 123456
PUK: 12345678
Management Key: 010203040506070801020304050607080102030405060708 |
Reopening this because we should give some guidance in the error message when we detect there are no PIN attempts remaining. In particular, for a YubiKey configured for this plugin, a user has three more attempts to remember and recover, because their PUK gets set to their PIN. |
That's a great point! One more thing that I noticed is that ykman seems to be able to detect that the default PINs are in place: $ ykman piv info
PIV version: 5.4.3
PIN tries remaining: 3/3
Management key algorithm: 3
WARNING: Using default PIN!
WARNING: Using default Management key!
CHUID: No data available
CCC: No data available If it's possible for age-plugin-yubikey to see that too, I'd suggest changing the |
In case others find this, the way I got my three more attempts is via
|
Environment
What were you trying to do
I tried generating a key on a blank yubikey 5c nano.
What happened
I failed multiple times to correctly identify what the plugin was asking me to do (namely, enter the pin
123456
), locking myself out:The attempts above, I failed to remember that it's not asking me the PIN for the GPG PIV app, but asks me to enter the default PIN. Oops.
So - how do I get it out of this state? I tried factory-resetting it with
gpg --card-edit
, which didn't work (and in retrospect can't do anything either, since they're different apps on the key).The text was updated successfully, but these errors were encountered: