Last active
September 9, 2024 12:25
-
-
Save pkirkovsky/c3d703633effbdfcb48c to your computer and use it in GitHub Desktop.
Utility for resetting a Yubikey to factory defaults using gpg-connect-agent. This will wipe out any stored keys and reset PINs to default values.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://developers.yubico.com/ykneo-openpgp/ResetApplet.html | |
gpg-connect-agent <<EOF | |
/hex | |
scd serialno | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 e6 00 00 | |
scd apdu 00 44 00 00 | |
/echo Yubikey has been successfully reset. | |
/echo The factory default PINs are 123456 (user) and 12345678 (admin). | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment