jstarks / npiperelay

npiperelay allows you to access Windows named pipes from WSL
MIT License
660 stars 71 forks source link

WSL 2 SSH agent public key authentication issues with specific site #21

Closed wizonesolutions closed 3 years ago

wizonesolutions commented 3 years ago

I am encountering the strangest issue, and since npiperelay.exe is probably the most unique part of the setup, I figured I'd ask here first, if not just to get help figuring out where to even begin debugging.

The issue: SSH login works from Windows but not from within WSL 2.

I am forwarding the agent from Windows into WSL 2 with this command:

socat UNIX-LISTEN:/home/kevin/.ssh/agent.sock,fork EXEC:npiperelay.exe -ei -s //./pipe/openssh-ssh-agent,nofork

(Specifically, I'm using the script explained in https://stuartleeks.com/posts/wsl-ssh-key-forward-to-windows/ .)

Like this, I can connect to Bitbucket, GitHub, and GitLab without issue. However, the version of GitLab EE used by drupal.org (git.drupal.org) appears to be problematic. For some reason, connecting there only works in Windows.

I have tried:

I have run ssh -vvv to try and compare output from a successful connection vs. a failed connection, but all I can surmise is that the moduli are not matching in the way SSH wants, so the public key authentication fails.

There is clearly something about git.drupal.org's configuration involved here, but I don't know what it could be. I haven't seen any obvious errors from ssh either. Is this problem even debuggable?

wizonesolutions commented 3 years ago

User error. I had this in ~/.ssh/config in WSL 2:

Host git.drupal.org
  PubkeyAcceptedKeyTypes ssh-rsa

Not sure why it failed exactly like that, but removing it fixed the issue.