Skip to content

Instantly share code, notes, and snippets.

@chuckntaylor
Last active November 16, 2021 02:39
Show Gist options
  • Save chuckntaylor/0d5bd1df91758f2eca26a0021241b2b4 to your computer and use it in GitHub Desktop.
Save chuckntaylor/0d5bd1df91758f2eca26a0021241b2b4 to your computer and use it in GitHub Desktop.
Remove GPG Yubikey, and enable another one

[OPTIONAL] list the keygrip IDs using

gpg --list-secret-keys --with-keygrip

If ALL your private keys are on external cards like the Yubikey, you can delete them all using:

rm -r ~/.gnupg/private-keys-v1.d

After the deletion of the keygrips, it seems beneficial to run

gpgconf --kill gpg-agent
gpg --card-status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment