Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scard Sharing violation #41

Open
forsberg opened this issue Nov 7, 2019 · 3 comments
Open

scard Sharing violation #41

forsberg opened this issue Nov 7, 2019 · 3 comments

Comments

@forsberg
Copy link

forsberg commented Nov 7, 2019

From time to time (multiple times a day, usually), I get this problem:

awsu -p <profile> -- <command>
error: failed to aquire credentials for profile "default": failed to initialize Yubikey: failed to establish context: scard: Sharing violation.

Unplugging and plugging the Yubikey, or running ykman oauth code <profile name> resets things to a working state.

Perhaps this should rather be reported on some Yubikey go library?

@yawn
Copy link
Contributor

yawn commented Mar 15, 2020

I cannot really reproduce the issue. Will retries also solve it? Or do you need to physically unplug / re-plug the device?

@tolleiv
Copy link

tolleiv commented Apr 19, 2021

For me this happens related to the OpenPGP/Smartcard features of the Yubikey. Parallel to awsu I also use Yubikey to keep my SSH keys private (as described here https://florin.myip.org/blog/easy-multifactor-authentication-ssh-using-yubikey-neo-tokens ) and whenever I used the related OpenPGP agent to pull the private key, awsu would run into this issue. Running ykman oath code ... in between would reset the OpenPGP agent and also allow awsu to access the Yubikey without errors.

@yawn
Copy link
Contributor

yawn commented Jun 7, 2022

Finally reproduced it and tracked it here: yawn/ykoath#14.

I believe the easiest fix is to have platform specific recovery options such as (e.g. on Mac) sending KILL to com.apple.ctkpcscd. Or use aliases e.g. alias awsu="killall com.apple.ctkpcscd; awsu"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants