I’m using Yubikeys for SSH authorization, and as you probably know they can work in PGP or PIV mode. Although I don’t quite like certain things about PIV mode, so I’m typically using it in a PGP mode, and thus I’m using gpg-agent as my ssh-agent.
But on some rare occasions I’m using a key backed up by a file, and when such key is loaded, GPG offers you to save it in the gpg storage and time to time you might need to remove this key 😀. As you can imagine, normal ssh-add -d isn’t working in such cases, because the key is already copied. Although you still can remove it, and here is how:
1 2 | |
Now let’s connect to GPG agent:
1 2 3 4 5 6 7 | |
So here, I matched the key by the SHA256 fingerprint. Also, when you are using gpg-connect-agent you can use help and help <COMMAND> commands. For example:
1 2 3 4 5 6 7 8 9 10 | |
I originally found it in gpg mail list and ended up using few times, and each time I had to search for it, so I decided to make this post as memo for me.