Win 11 + Smarcard: SSH public key authentication fails


in the past I used
Windows 10 + Smartcard + MobaXterm
for SSH public key authentication w/o problems incl. SSH forward.

Now I have a new device with Windows 11, and I want to use the same Smartcard for SSH public key authentication using Win 11 (native) SSH client.

Therefore I installed

  • Gpg4win 4.2 (latest version)
  • PowerShell 7 (latest version)
  • PuTTY 0.8 (latest version)

and configured gpg.conf and gpg-agent.conf.
I don’t intend to install git BASH assuming PowerShell 7 provides a working shell.

I can run gpg --card-status and ssh-add -L w/o problems, means I can display all information stored on my Smartcard and the SSH public key (key ends with “cardno:0005_000080CE”.

However when I try to connect to a SSH server public key authentication fails.

I found this statement when searching for a solution:
“[…] The ssh-pageant provides the same kind of functionality to ssh but, as opposed to ssh-agent, does speak the PuTTY protocol. This enables ssh to speak with the gpg-agent via the ssh-pageant.[…]”

Can you please advise how to fix this issue?

do you have enable-win32-openssh-support in your gpg-agent.conf? I personally have not used it but it is supposed to work. Maybe this option already helps otherwise I have to forward / refer you to the developer whi implemented that. Please let us know.