I'm using gpg4win on my Windows client to sign commits to Git with my Yubikey. This is working fine and I'm trying to accomplish the same on a remote Linux machine by forwarding my S.gpg-agent.extra socket on Windows to my remote Linux machine, using SSH. I used this guide to accomplish this.
The socket forwarding seems to work as I can see the socket on my remote Linux machine. However, executing something like gpg --list-secret-keys on my remote Linux machine returns:
connect to /c/Users/martijn/AppData/Local/gnupg/S.gpg-agent.extra port -2 failed: Bad file descriptor
I've added the following host configuration to my .ssh/config file in my Windows home:
Host my-remote-host.net
HostName my-remote-host.net
User martijn
IdentityFile ~/.ssh/id_rsa
RemoteForward /run/user/8898/gnupg/S.gpg-agent /c/Users/martijn/AppData/Local/gnupg/S.gpg-agent.extra
ExitOnForwardFailure yes
Besides the GPG issue, the SSH tunnel itself is fully functional. I also verified that the S.gpg-agent.extra file exists in the given directory. Please feel free to ask for more information, if necessary.
What am I doing wrong?