git ssh from WSL unable to connect to our company's private internal git host

Viewed 345

I'm trying to set up my PC so that I can commit to our company's internal github equivalent from within WSL so I can avoid losing focus when I have to shutdown WSL VS Code to push from Windows. The rsa_key is set correctly on both server side and in WSL (including 600 permissions)

If I run the following in Windows in gitbash:

ssh -p [default port for that site] myusername@[our_internal_git_host]

it connects successfully, but if I run the same command in WSL (WSL 1, Ubuntu), I get

ssh: Could not resolve hostname

But if I try the following as a test from wsl:

ssh git@github.com

It is able to connects and asks me about RSA keys, so ssh is not blocked from WSL entirely by my Windows firewall (which I don't have permission to configure, by the way)

This suggests to me that either this some security setting on the internal git host site that I can do nothing about, or more likely that it is a port forwarding issue.

To test if I'm correct, using the ssh command, I have to use something like ssh -L flag so that it uses the WSL outgoing port which is allowed for SSH to connect to public github, and but then uses the [default port for that site] to connect with it.

Then as a second step, I probably add something to a config file for open-ssh, git, or both in WSL to make that solution take effect when I try to run git push from WSL.

By the way, sorry about being vague about some specifics, just trying to be extra careful re: proprietary info and security concerns.

Does anyone have any ideas?

0 Answers
Related