Created
May 12, 2020 11:59
-
-
Save chrisswanda/76c7af3bc0d8c42618216aa5ad8b1371 to your computer and use it in GitHub Desktop.
Remove SSH key from GPG agent keyring
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
keys=$(gpg-connect-agent 'keyinfo --list' /bye | awk '{print $3}') | |
for key in $keys; do gpg-connect-agent "delete_key $key --force" /bye; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, with your first line, all keys are deleted from the gpg-agent keyring, i.e SSH keys and GPG secret keys.
You can verify your GPG secret keys with:
To remove only SSH keys: