I use Yubikey to connect to multiple servers. I am doing this under windows and this works perfectly fine with my sshconfig in the .ssh directory.
Now I have a case where I need to run some things under linux and connect to the same servers also using the YubiKey. So I installed WSL (Ubuntu) and copied my config and keys from my Windows SSH config to the WSL environment. SSH generally works fine when connection to a server thats only using a password or only a key file without YubiKey.
But every connection that requires the YubiKey fails with the following error (changed IPs and names for obvious reasons):
Confirm user presence for key ED25519-SK SHA256:BnVjcbhrBbURNA7KSkTI22C0Z9/6avSGpC72GbIvOJw
sign_and_send_pubkey: signing failed for ED25519-SK "/home/kgr/.ssh/keys/admin@server": device not found
[email protected]: Permission denied (publickey).
Sadly I could not find anything regarding the "device not found" that occurs here.
Any hints on what could causing this or are there some special steps that are required for WSL to use the YubiKey correctly?
EDIT: I forgot somethin to mention, since it made no difference:
I followed the article on https://levelup.gitconnected.com/how-to-use-a-yubikey-in-wsl2-linux-on-windows-96f176518583 but without success. Once I try to use any gpg commands in WSL, it says no such device, while it works in windows.
I also found comments online that the .bashrc entry has to point to the config in AppDataLocal since Gpg4win Version 4. But I also tried that and it made no difference.
EDIT2: after some helpful comments I could see my card with gpg --card-status in WSL. Anyhow the ssh connection still fails with the same error. One thing I noticed when running gpg --card-status is that the "Version" entry shows "0". Not sure how relevant this. Since currently everything seems to work but ssh fails, I am bit clueless.