Yubico Forum
https://forum.yubico.com/

Please remove the current card and insert the one with seria
https://forum.yubico.com/viewtopic.php?f=4&t=2135
Page 1 of 1

Author:  moacybarros [ Tue Dec 22, 2015 3:55 am ]
Post subject:  Please remove the current card and insert the one with seria

I have two yubikeys and I am trying to reproduce the process to replace one key in case I loose it.
Basically I use yubikey for OTP and GPG(ssh and sign code/commits/branches...), I imported the same set of keys to both yuikeys, when I try to use the second yubikey to do the same tasks I face this issue: "Please remove the current card and insert the one with serial number:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Hit return when ready or enter 'c' to cancel:"
ssh and git seems to be keeping references to the old key hardware, serial, and it is not accepting the new one. I found a workaround for the ssh issue in this url: http://donncha.is/2014/07/problems-using-an-openpgp-smartcard-for-ssh-with-gpg-agent/
But was not able to find a workaround for the git issue.
I really appreciate any help.

Thanks,
Moacy Barros

Author:  markchalloner [ Wed Nov 09, 2016 12:54 pm ]
Post subject:  Re: Please remove the current card and insert the one with s

A bit of an old thread, but I had the same problem. I found it was because my secret keys were also stored in my gpgkeyring (had been messing around with PIV). To fix

Delete secret keys from keyring
Code:
gpg2 --delete-secret-key [KEYID]

Verify keys are gone
Code:
gpg -K

Re-add secret key stubs
Code:
gpg --card-status

Restart gpg-agent for good measure
Code:
PID=$(ps -A | grep "gpg-agent --daemon" | grep -v "grep" | awk '{print $1}'); [ -n "${PID}" ] && kill -9 "${PID}"; eval $(gpg-agent --daemon)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/