You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in wsl2 when I use ssh to login a remote server, the connection closed immediately.
I change the distro to v1, the connection can establish.
when use git (with ssh-key) to push file to github, it fail too. it says:
Received disconnect from 13.250.177.223 port 22:11: Bye Bye
Disconnected from 13.250.177.223 port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Might be #4199 related. But probably (?) not. There isn't enough in the OP to tell definitively. You can get that fatal for all manner of reasons. Above you are on the client side. Github doesn't care if your local IP address changed. On the other hand, you'd care a lot if Github's IP address kept changing and you couldn't do a DNS lookup on github.com.
Only way to tell conclusively would be set up your keys again and see if that fixes the problem. Which isn't really a WSL question, ever shifting client IP address or not. Not to diminish the other issue. [N.b. I retired from diving ssh problems a couple of years ago because ssh does work as advertised on both WSL1 and WSL2.]
not a bug? Is this a feature?
if this is a feature, why saying this:
In the initial builds of the WSL 2 preview, you will need to access any Linux server from Windows using the IP address of your Linux distro, and any Windows server from Linux using the IP address of your host machine. This is something that is temporary, and very high on our priority list to fix.
Because that paragraph has nothing to do with your OP. Git push to github works in WSL2 regardless of whether "you will need to access any Linux server from Windows using the IP address of your Linux distro".
No bug has been identified here
The word "identified" is important here. That you cannot push to Github does not identify a bug. Indeed, the scope for bugs has shrunken considerably in WSL2 (vs. WSL1) because you'd have to conclude you found something new and novel wrong with either (a) Hyper-V or (b) the Linux kernel.
The reason for your "fatal: Could not read from remote repository" is, to be clear, neither of those things. Whatever the reason may be. And so the obv isn't lost: git push WSL2 to github works. That you've decided to use Windows OpenSSH instead, for whatever reasons, is fine also; that works too.
The cap below is superfluous. If "[wsl2] can't use ssh" were a bug, you'd know from the screeching.
Reacted by hiyyg, Matthew Davis and RichieUltimate
Thank you for let me know how to identify a bug in wsl.
It must be something wrong with the network that makes ssh can't connect remote server, but I don't have the time to solve it. So I open a issue to let you guys know someone trouble about this, and how to avoid this.
I'll try to solve this after wsl2 stable release, if it has the same problem.
Encountered the same issue at WSL2, but after digging further I have a workaround here.
Try to explicitly specify ciphers at /etc/ssh/ssh_config, or run ssh -oCiphers=your_ciphers username@domain. It works for me. NEED TO KEEP THE CIPHER STRING SHORT
Update: I looked up the journals of ssh.service on the other side and got the following message: error: kex_input_kexinit: discard proposal: string is too large [preauth]
It seems to be a issue of OpenSSH Client or the network part of Linux kernel.(TBH, I don't know how it works, so it might be wrong)
I just upgraded to WSL2 along with latest Windows 10, 2020 and I cannot ssh to any of our servers now. I have to go to the cmd or powershell it's a bummer. I was excited about WSL2.
I have to add ssh-add ~/.ssh/<name_of_private_key_file> 2> /dev/null to my .zshrc file for it to work. It seems like every session the keys have to be added again. That's the bug to me, I would expect to only have to do that once ever.
Hi all, i've found the solution here
[(https://github.community/t/having-an-issue-pull-and-push-in-github/13198/2)]
create a file called config in folder ~/.ssh cd ~/.ssh nano config
paste the following Host github.com KexAlgorithms=ecdh-sha2-nistp521
Activity
therealkenc commentedon Jun 22, 2019
Might be #4199 related. But probably (?) not. There isn't enough in the OP to tell definitively. You can get that
fatalfor all manner of reasons. Above you are on the client side. Github doesn't care if your local IP address changed. On the other hand, you'd care a lot if Github's IP address kept changing and you couldn't do a DNS lookup ongithub.com.Only way to tell conclusively would be set up your keys again and see if that fixes the problem. Which isn't really a WSL question, ever shifting client IP address or not. Not to diminish the other issue. [N.b. I retired from diving
sshproblems a couple of years ago becausesshdoes work as advertised on both WSL1 and WSL2.]transtone commentedon Jun 22, 2019
because of this annoying bug, I decide not use the ssh client of wsl distro, but use OpenSSH in
C:\WINDOWS\System32\OpenSSH. this do solve my problem.therealkenc commentedon Jun 22, 2019
Well let's be clear - no. No bug has been identified here. But happy to hear you are unblocked.
transtone commentedon Jun 23, 2019
not a bug? Is this a feature?
if this is a feature, why saying this:
In the initial builds of the WSL 2 preview, you will need to access any Linux server from Windows using the IP address of your Linux distro, and any Windows server from Linux using the IP address of your host machine. This is something that is temporary, and very high on our priority list to fix.therealkenc commentedon Jun 23, 2019
Because that paragraph has nothing to do with your OP. Git push to github works in WSL2 regardless of whether "you will need to access any Linux server from Windows using the IP address of your Linux distro".
The word "identified" is important here. That you cannot push to Github does not identify a bug. Indeed, the scope for bugs has shrunken considerably in WSL2 (vs. WSL1) because you'd have to conclude you found something new and novel wrong with either (a) Hyper-V or (b) the Linux kernel.
The reason for your "
fatal: Could not read from remote repository" is, to be clear, neither of those things. Whatever the reason may be. And so the obv isn't lost:git pushWSL2 to github works. That you've decided to use Windows OpenSSH instead, for whatever reasons, is fine also; that works too.The cap below is superfluous. If "[wsl2] can't use ssh" were a bug, you'd know from the screeching.
transtone commentedon Jun 24, 2019
Thank you for let me know how to identify a bug in wsl.
It must be something wrong with the network that makes ssh can't connect remote server, but I don't have the time to solve it. So I open a issue to let you guys know someone trouble about this, and how to avoid this.
I'll try to solve this after wsl2 stable release, if it has the same problem.
CamberLoid commentedon May 21, 2020
Encountered the same issue at WSL2, but after digging further I have a workaround here.
Try to explicitly specify ciphers at /etc/ssh/ssh_config, or run
ssh -oCiphers=your_ciphers username@domain. It works for me. NEED TO KEEP THE CIPHER STRING SHORTUpdate: I looked up the journals of ssh.service on the other side and got the following message:
error: kex_input_kexinit: discard proposal: string is too large [preauth]It seems to be a issue of OpenSSH Client or the network part of Linux kernel.(TBH, I don't know how it works, so it might be wrong)
Update: New issue opened. For details see #5244.
Now I know that the issue should be blamed to the too-large preauth string, and explicitly config ciphers might be a workaround.
KexyBiscuit commentedon May 21, 2020
Camber Huang (@CamberLoid) Open a new issue might help since this one has been closed for a long time.
pdelaney-802 commentedon Jun 18, 2020
I just upgraded to WSL2 along with latest Windows 10, 2020 and I cannot ssh to any of our servers now. I have to go to the cmd or powershell it's a bummer. I was excited about WSL2.
thedevelopnik commentedon Jun 19, 2020
I have to add
ssh-add ~/.ssh/<name_of_private_key_file> 2> /dev/nullto my .zshrc file for it to work. It seems like every session the keys have to be added again. That's the bug to me, I would expect to only have to do that once ever.therealkenc commentedon Jun 19, 2020
That was mentioned in message with open issue landing zones #4711 #4199 #4210 (depending on one's disposition).
hiyyg commentedon Sep 5, 2020
I can not use ssh in wsl2. I have to change it back to wsl 1.
robertzhangwenjie commentedon Sep 12, 2020
I also encountered this issue in wsl2, its a annoying bug.
acmuller commentedon Oct 4, 2020
Just installed WSL2, and I also can't SSH to any of my servers. Rolling back to WSL1
behnam-io commentedon Jul 3, 2021
I'm also facing this issue. Any fix since then?
shimbalama commentedon Sep 14, 2021
same
AbdelrahmanElsaidElsawy commentedon Nov 23, 2021
Hi all, i've found the solution here
[(https://github.community/t/having-an-issue-pull-and-push-in-github/13198/2)]
cd ~/.sshnano configHost github.com KexAlgorithms=ecdh-sha2-nistp521