Repository navigation
Description
-
Your Windows build number: (Type
verat a Windows Command Prompt)
Microsoft Windows [Version 10.0.17728.1000] -
What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
Powered off my Surface Book 2, and power on. SSH on WSL(ubuntu) doesn't work. It hangs there, can't do Ctrl + C. However, ssh on windows cmd is successful. And this never happened to me in previous builds. Besides, after rebooting (instead of powering off), things went back to normal. Verbose log is as below:
OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /home/michaelht/.ssh/config
debug1: /home/michaelht/.ssh/config line 12: Applying options for erda
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to HOSTNAME [HOSTIP] port 22.
debug1: Connection established.
debug1: identity file /home/michaelht/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/michaelht/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/michaelht/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/michaelht/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/michaelht/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/michaelht/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/michaelht/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/michaelht/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4
debug1: match: OpenSSH_7.6p1 Ubuntu-4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to HOSTNAME:22 as 'michaelht'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ERZ2W+O9hyjot+mU8FUAAqzSvbgxizdF5hL6BnpdIOI
debug1: Host 'HOSTNAME' is known and matches the ECDSA host key.
debug1: Found key in /home/michaelht/.ssh/known_hosts:24
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/michaelht/.ssh/id_rsa
debug1: Server accepts key: pkalg rsa-sha2-512 blen 535
debug1: Authentication succeeded (publickey).
Authenticated to HOSTNAME ([HOSTIP]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Requesting authentication agent forwarding.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_CTYPE = en_US.UTF-8
-
What's wrong / what should be happening instead:
Should connect successfully. -
Strace of the failing command, if applicable: (If
some_commandis failing, then runstrace -o some_command.strace -f some_command some_args, and link the contents ofsome_command.stracein a gist here).
https://gist.github.com/MichaelTong/323c0e89ab48b2d2f84a78e3b39bbec9
Activity
MichaelTong commentedon Aug 2, 2018
Please help me too if anything is wrong with my setups or anything. Thank you!
Brian-Perkins commentedon Aug 2, 2018
I have no issues running ssh on 17728. Looking through your strace it looks like you have ssh-agent running as well. There is a fix in this build (#3183) that may mean your ssh-agent is working differently (hopefully better) than before. It would be worth ruling that out as a problem. Also a simple test like starting ssh locally (sudo apt install openssh-server; sudo service ssh start) and connecting would be good since you can get debug output from both sides.
MichaelTong commentedon Aug 2, 2018
Brian Perkins (@Brian-Perkins) I'll try that when I encounter this issue again.
Interestingly, my Ubuntu is still 16.04, does that mean insider build fixed something for 18.04 but broke for 16.04?
jimcroft commentedon Aug 6, 2018
Same issue here (with or without ssh-agent running), Ubuntu 18.04, Win10 build 17730.
MichaelTong commentedon Aug 6, 2018
This still happens when I disabled ssh-agent or ForwardAgent.
Brian-Perkins commentedon Aug 6, 2018
Thanks Hao Tong (@MichaelTong). My next suggestion would be to start sshd locally and attempt to connect. If that fails then we can compare logs from both sides of the connection.
MichaelTong commentedon Aug 6, 2018
Brian Perkins (@Brian-Perkins)
Here I attached the debug info from sshd and ssh-client.
Server
Client
MichaelTong commentedon Aug 7, 2018
Brian Perkins (@Brian-Perkins) Does the debug logs tell you anything?
Brian-Perkins commentedon Aug 7, 2018
Unfortunately nothing jumps out at me from the debug messages. In fact from the information there I would have guessed you were presented with a shell. I will have to look more closely through the strace log you provided.
therealkenc commentedon Aug 8, 2018
Hao Tong (@MichaelTong) - what's your shell,
/bin/bashor something else [ed:Occam says interopit isn't interop]. Can you think of any other variables in your setup that differ from a stock install (both on the Windows 10 side and the WSL/Ubuntu side).What is probably needed here is a
stracelog on the localhost server, because the client is just sitting there hoping for something to be sent.[ed] Also try a quick test to see if you can get text between terminals at all. Probably will but it is worth half a minute to look.
In one terminal:
Another:
MichaelTong commentedon Aug 8, 2018
Brian Perkins (@Brian-Perkins) therealkenc
sshd strace
client strace
I'm using zsh with oh-my-zsh, but I tried on /bin/bash, it doesn't work either.
Basically, I don't change much on the stock settings except for the shell, and I added
umask 22to.zshrcand.profile. I'm using the latest Ubuntu app from store, on 16.04, and Windows faster ring build 17730. Besides, I'm starting ssh-agent from.zshrcor.profiletoo.Text between terminals works for me.
MichaelTong commentedon Aug 8, 2018
And I think #3430 seems to related to my issue, and Carlo Calica (@carlocalica) said WSL uptime was negative 3 years on first startup. I didn't see the negative years anywhere, but rebooting windows did resolve the issue.
therealkenc commentedon Aug 8, 2018
It's in your sshd strace log:
Thing is, you are on 17728, and #3399 #3252 et al should be fixed in that release.
MichaelTong commentedon Aug 8, 2018
therealkenc And in my case it is not like #3399 #3252 that their system has been up for a long time and I can't reproduce their issues.
Here is strace from a remote server which is running Ubuntu 18.04.1. strace There doesn't seem to be any bugs like negative time value. But still, client from WSL can't connect to the remote server.
Please do tell me if there is any thing I can help to debug.
therealkenc commentedon Aug 8, 2018
Can you connect to that remote (looks like Real Linux) 18.04.1 box using PuTTY (or pick whatever win32 ssh client) on the Windows side from the (failing) WSL box? We're in pretty uncharted territory here though. I would have bet a buck it was the server side, which you have eliminated.
23 remaining items
benhillis commentedon Aug 16, 2018
Kevin Ying (@k-y) - I suspect you are hitting #3252.
Could you provide the output of this command?
cmd.exe /c systeminfo | find "System Boot Time:"k-y commentedon Aug 16, 2018
Ben Hillis (@benhillis)
System Boot Time: 8/13/2018, 4:24:23 PMbenhillis commentedon Aug 16, 2018
Kevin Ying (@k-y) - Interesting. And if you reboot (actual reboot, not shut down) does the problem go away?
k-y commentedon Aug 16, 2018
Ben Hillis (@benhillis) Yup. I'll look into if I can upgrade my laptop to an insiderbuild.
benhillis commentedon Aug 16, 2018
Kevin Ying (@k-y) - Thanks, that would be useful. I suspect you won't have any issues with 17738 or later, but if not please let me know and we can continue to debug this.
emmatyping commentedon Aug 30, 2018
Ben Hillis (@benhillis) FWIW I am seeing this exact same issue on build 18219. Restarting did indeed work around it. Perhaps the patch didn't make it to skip ahead?
benhillis commentedon Aug 30, 2018
ethanhs - Yeah unfortunately the fix is not in skip ahead yet, but will be very soon.
k-y commentedon Sep 4, 2018
Ah yes, I had updated to 17134 and just had the issue. Rebooting to update to 17751.
whereisaaron commentedon Nov 27, 2018
I get this stuck ssh connections situation every now and them with since Win10 1803. Any attempt to connect with ssh just hangs forever. I restart the 'LxssManager' service and that fixes it for me.
robcxyz commentedon Dec 6, 2018
While the fix is coming to overcome this run per Aaron Roydhouse (@whereisaaron) comment. It shows up for me after my computer has been on for about a week or so.
Yehonal commentedon May 4, 2020
my client hanged at debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
I had to lower the MTU value. Now it works