Skip to content

SSH hangs after machine powered on sometimes. #3434

Closed

Description

@MichaelTong
  • Your Windows build number: (Type ver at 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

Activity

  1. MichaelTong commented on Aug 2, 2018

    @MichaelTong
    Author

    Please help me too if anything is wrong with my setups or anything. Thank you!

  2. Brian-Perkins commented on Aug 2, 2018

    @Brian-Perkins
    Contributor

    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.

  3. MichaelTong commented on Aug 2, 2018

    @MichaelTong
    Author

    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?

  4. jimcroft commented on Aug 6, 2018

    @jimcroft

    Same issue here (with or without ssh-agent running), Ubuntu 18.04, Win10 build 17730.

  5. MichaelTong commented on Aug 6, 2018

    @MichaelTong
    Author

    This still happens when I disabled ssh-agent or ForwardAgent.

  6. Brian-Perkins commented on Aug 6, 2018

    @Brian-Perkins
    Contributor

    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.

  7. MichaelTong commented on Aug 6, 2018

    @MichaelTong
    Author

    Brian Perkins (@Brian-Perkins)
    Here I attached the debug info from sshd and ssh-client.

    Server

     * Starting OpenBSD Secure Shell server sshd                                                                                  
    debug2: load_server_config: filename /etc/ssh/sshd_config
    debug2: load_server_config: done config len = 762
    debug2: parse_server_config: config /etc/ssh/sshd_config len 762
    debug1: sshd version OpenSSH_7.2, OpenSSL 1.0.2g  1 Mar 2016
    debug1: private host key #0: ssh-rsa SHA256:X7wqFKr45FHavGVRe1GXKfTWKTVaRmJk0WOyas7Wf8A
    debug1: private host key #1: ssh-dss SHA256:RfM/ElAzLRY0sO7FSQZxFgq8l9h4nxMzLVIpKVc8oHY
    debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:az3SiX5IiSEfjUOI9CVh5Un8WR1Z6TOPbmA8TybdW9g
    debug1: private host key #3: ssh-ed25519 SHA256:sDh5ZLh7y3jnYIK2lc1Mnj8uPNj1p6ZLRbe1qBOTJlE
    debug1: rexec_argv[0]='/usr/sbin/sshd'
    debug1: rexec_argv[1]='-dd'
    debug1: Set /proc/self/oom_score_adj from 0 to -1000
    debug2: fd 3 setting O_NONBLOCK
    debug1: Bind to port 22 on 0.0.0.0.
    Server listening on 0.0.0.0 port 22.
    debug2: fd 4 setting O_NONBLOCK
    debug1: Bind to port 22 on ::.
    Server listening on :: port 22.
    debug1: Server will not fork when running in debugging mode.
    debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
    debug1: inetd sockets after dupping: 3, 3
    Connection from 127.0.0.1 port 56010 on 127.0.0.1 port 22
    debug1: Client protocol version 2.0; client software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
    debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH* compat 0x04000000
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
    debug2: fd 3 setting O_NONBLOCK
    debug2: Network child is on pid 634
    debug1: permanently_set_uid: 110/65534 [preauth]
    debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
    debug1: SSH2_MSG_KEXINIT sent [preauth]
    debug1: SSH2_MSG_KEXINIT received [preauth]
    debug2: local server KEXINIT proposal [preauth]
    debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 [preauth]
    debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
    debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] [preauth]
    debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] [preauth]
    debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
    debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
    debug2: compression ctos: none,[email protected] [preauth]
    debug2: compression stoc: none,[email protected] [preauth]
    debug2: languages ctos:  [preauth]
    debug2: languages stoc:  [preauth]
    debug2: first_kex_follows 0  [preauth]
    debug2: reserved 0  [preauth]
    debug2: peer client KEXINIT proposal [preauth]
    debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c [preauth]
    debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa [preauth]
    debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc [preauth]
    debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc [preauth]
    debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
    debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
    debug2: compression ctos: none,[email protected],zlib [preauth]
    debug2: compression stoc: none,[email protected],zlib [preauth]
    debug2: languages ctos:  [preauth]
    debug2: languages stoc:  [preauth]
    debug2: first_kex_follows 0  [preauth]
    debug2: reserved 0  [preauth]
    debug1: kex: algorithm: [email protected] [preauth]
    debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
    debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none [preauth]
    debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none [preauth]
    debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
    debug2: monitor_read: 6 used once, disabling now
    debug2: set_newkeys: mode 1 [preauth]
    debug1: rekey after 134217728 blocks [preauth]
    debug1: SSH2_MSG_NEWKEYS sent [preauth]
    debug1: expecting SSH2_MSG_NEWKEYS [preauth]
    debug2: set_newkeys: mode 0 [preauth]
    debug1: rekey after 134217728 blocks [preauth]
    debug1: SSH2_MSG_NEWKEYS received [preauth]
    debug1: KEX done [preauth]
    debug1: userauth-request for user michaelht service ssh-connection method none [preauth]
    debug1: attempt 0 failures 0 [preauth]
    debug2: parse_server_config: config reprocess config len 762
    debug2: monitor_read: 8 used once, disabling now
    debug2: input_userauth_request: setting up authctxt for michaelht [preauth]
    debug2: input_userauth_request: try method none [preauth]
    debug1: PAM: initializing for "michaelht"
    debug1: PAM: setting PAM_RHOST to "127.0.0.1"
    debug1: PAM: setting PAM_TTY to "ssh"
    debug2: monitor_read: 100 used once, disabling now
    debug1: userauth-request for user michaelht service ssh-connection method publickey [preauth]
    debug1: attempt 1 failures 0 [preauth]
    debug2: input_userauth_request: try method publickey [preauth]
    debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for RSA SHA256:VB1/bYw2pqJ77hf7SM05TEW/rgZzOgN5lYUIfcXUr5s [preauth]
    debug2: monitor_read: 4 used once, disabling now
    debug1: temporarily_use_uid: 1000/1000 (e=0/0)
    debug1: trying public key file /home/michaelht/.ssh/authorized_keys
    debug1: Could not open authorized keys '/home/michaelht/.ssh/authorized_keys': No such file or directory
    debug1: restore_uid: 0/0
    debug1: temporarily_use_uid: 1000/1000 (e=0/0)
    debug1: trying public key file /home/michaelht/.ssh/authorized_keys2
    debug1: Could not open authorized keys '/home/michaelht/.ssh/authorized_keys2': No such file or directory
    debug1: restore_uid: 0/0
    Failed publickey for michaelht from 127.0.0.1 port 56010 ssh2: RSA SHA256:VB1/bYw2pqJ77hf7SM05TEW/rgZzOgN5lYUIfcXUr5s
    debug2: userauth_pubkey: authenticated 0 pkalg rsa-sha2-512 [preauth]
    debug1: userauth-request for user michaelht service ssh-connection method password [preauth]
    debug1: attempt 2 failures 1 [preauth]
    debug2: input_userauth_request: try method password [preauth]
    debug1: PAM: password authentication accepted for michaelht
    debug1: do_pam_account: called
    Accepted password for michaelht from 127.0.0.1 port 56010 ssh2
    debug1: monitor_child_preauth: michaelht has been authenticated by privileged process
    debug1: monitor_read_log: child log fd closed
    debug1: PAM: establishing credentials
    User child is on pid 663
    debug1: SELinux support disabled
    debug1: PAM: establishing credentials
    debug1: permanently_set_uid: 1000/1000
    debug2: set_newkeys: mode 0
    debug1: rekey after 134217728 blocks
    debug2: set_newkeys: mode 1
    debug1: rekey after 134217728 blocks
    debug1: ssh_packet_set_postauth: called
    debug1: Entering interactive session for SSH2.
    debug2: fd 5 setting O_NONBLOCK
    debug2: fd 6 setting O_NONBLOCK
    debug1: server_init_dispatch_20
    debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
    debug1: input_session_request
    debug1: channel 0: new [server-session]
    debug2: session_new: allocate (allocated 0 max 10)
    debug1: session_new: session 0
    debug1: session_open: channel 0
    debug1: session_open: session 0: link with channel 0
    debug1: server_input_channel_open: confirm session
    debug1: server_input_global_request: rtype [email protected] want_reply 0
    debug1: server_input_channel_req: channel 0 request pty-req reply 1
    debug1: session_by_channel: session 0 channel 0
    debug1: session_input_channel_req: session 0 req pty-req
    debug1: Allocating pty.
    debug2: session_new: allocate (allocated 0 max 10)
    debug1: session_new: session 0
    debug1: SELinux support disabled
    debug1: session_pty_req: session 0 alloc /dev/pts/0
    debug1: server_input_channel_req: channel 0 request env reply 0
    debug1: session_by_channel: session 0 channel 0
    debug1: session_input_channel_req: session 0 req env
    debug2: Setting env 0: LANG=en_US.UTF-8
    debug1: server_input_channel_req: channel 0 request env reply 0
    debug1: session_by_channel: session 0 channel 0
    debug1: session_input_channel_req: session 0 req env
    debug2: Setting env 1: LC_CTYPE=en_US.UTF-8
    debug1: server_input_channel_req: channel 0 request shell reply 1
    debug1: session_by_channel: session 0 channel 0
    debug1: session_input_channel_req: session 0 req shell
    Starting session: shell on pts/0 for michaelht from 127.0.0.1 port 56010 id 0
    debug2: fd 3 setting TCP_NODELAY
    debug1: Setting controlling tty using TIOCSCTTY.
    debug2: channel 0: rfd 9 isatty
    debug2: fd 9 setting O_NONBLOCK
    [Closed client window after a few minutes]
    Received disconnect from 127.0.0.1 port 56010:11: disconnected by user
    Disconnected from 127.0.0.1 port 56010
    debug1: do_cleanup
    debug1: do_cleanup
    debug1: PAM: cleanup
    debug1: PAM: closing session
    debug1: PAM: deleting credentials
    debug1: session_pty_cleanup: session 0 release /dev/pts/0
    syslogin_perform_logout: logout() returned an error
    debug1: audit_event: unhandled event 12
    

    Client

    OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016
    debug1: Reading configuration data /home/michaelht/.ssh/config
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: resolving "localhost" port 22
    debug2: ssh_connect_direct: needpriv 0
    debug1: Connecting to localhost [127.0.0.1] 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.2p2 Ubuntu-4ubuntu2.4
    debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH* compat 0x04000000
    debug2: fd 3 setting O_NONBLOCK
    debug1: Authenticating to localhost:22 as 'michaelht'
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: local client KEXINIT proposal
    debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
    debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
    debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
    debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
    debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: compression ctos: none,[email protected],zlib
    debug2: compression stoc: none,[email protected],zlib
    debug2: languages ctos:
    debug2: languages stoc:
    debug2: first_kex_follows 0
    debug2: reserved 0
    debug2: peer server KEXINIT proposal
    debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
    debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
    debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
    debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
    debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: compression ctos: none,[email protected]
    debug2: compression stoc: none,[email protected]
    debug2: languages ctos:
    debug2: languages stoc:
    debug2: first_kex_follows 0
    debug2: reserved 0
    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:az3SiX5IiSEfjUOI9CVh5Un8WR1Z6TOPbmA8TybdW9g
    debug1: Host 'localhost' is known and matches the ECDSA host key.
    debug1: Found key in /home/michaelht/.ssh/known_hosts:39
    debug2: set_newkeys: mode 1
    debug1: rekey after 134217728 blocks
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: rekey after 134217728 blocks
    debug1: SSH2_MSG_NEWKEYS received
    debug2: key: /home/michaelht/.ssh/id_rsa (0x7fffc506af20), agent
    debug2: key: /home/michaelht/.ssh/id_dsa ((nil))
    debug2: key: /home/michaelht/.ssh/id_ecdsa ((nil))
    debug2: key: /home/michaelht/.ssh/id_ed25519 ((nil))
    debug1: SSH2_MSG_EXT_INFO received
    debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
    debug2: service_accept: ssh-userauth
    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
    debug2: we sent a publickey packet, wait for reply
    debug1: Authentications that can continue: publickey,password
    debug1: Trying private key: /home/michaelht/.ssh/id_dsa
    debug1: Trying private key: /home/michaelht/.ssh/id_ecdsa
    debug1: Trying private key: /home/michaelht/.ssh/id_ed25519
    debug2: we did not send a packet, disable method
    debug1: Next authentication method: password
    michaelht@localhost's password:
    debug2: we sent a password packet, wait for reply
    debug1: Authentication succeeded (password).
    Authenticated to localhost ([127.0.0.1]:22).
    debug1: channel 0: new [client-session]
    debug2: channel 0: send open
    debug1: Requesting [email protected]
    debug1: Entering interactive session.
    debug1: pledge: network
    debug1: client_input_global_request: rtype [email protected] want_reply 0
    debug2: callback start
    debug2: fd 3 setting TCP_NODELAY
    debug2: client_session2_setup: id 0
    debug2: channel 0: request pty-req confirm 1
    debug1: Sending environment.
    debug1: Sending env LANG = en_US.UTF-8
    debug2: channel 0: request env confirm 0
    debug1: Sending env LC_CTYPE = en_US.UTF-8
    debug2: channel 0: request env confirm 0
    debug2: channel 0: request shell confirm 1
    debug2: callback done
    debug2: channel 0: open confirm rwindow 0 rmax 32768
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: PTY allocation request accepted on channel 0
    debug2: channel 0: rcvd adjust 2097152
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: shell request accepted on channel 0
    
  8. MichaelTong commented on Aug 7, 2018

    @MichaelTong
    Author

    Brian Perkins (@Brian-Perkins) Does the debug logs tell you anything?

  9. Brian-Perkins commented on Aug 7, 2018

    @Brian-Perkins
    Contributor

    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.

  10. therealkenc commented on Aug 8, 2018

    @therealkenc

    Hao Tong (@MichaelTong) - what's your shell, /bin/bash or something else [ed: Occam says interop it 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 strace log on the localhost server, because the client is just sitting there hoping for something to be sent.

    sudo mkdir /run/sshd  # WSL still suffers from #2530
    sudo strace -f -o sshd.strace /usr/sbin/sshd -d
    

    [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:

    sudo apt install netcat-openbsd
    nc -4 -l 127.0.0.1 5000
    

    Another:

    nc -4 127.0.0.1 5000
    <type something>
    
  11. MichaelTong commented on Aug 8, 2018

    @MichaelTong
    Author

    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 22 to .zshrc and .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 .zshrc or .profile too.

    Text between terminals works for me.

  12. MichaelTong commented on Aug 8, 2018

    @MichaelTong
    Author

    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.

  13. therealkenc commented on Aug 8, 2018

    @therealkenc

    [Version 10.0.17728.1000]
    And I think #3430 seems to related
    I didn't see the negative years anywhere, but rebooting windows did resolve the issue.

    It's in your sshd strace log:

    275   clock_gettime(CLOCK_BOOTTIME, {-5653, -91928000}) = 0
    275   select(8, [5 7], [5], NULL, NULL) = 2 (in [5], out [5])
    275   rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
    275   rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    

    Thing is, you are on 17728, and #3399 #3252 et al should be fixed in that release.

  14. MichaelTong commented on Aug 8, 2018

    @MichaelTong
    Author

    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.

  15. therealkenc commented on Aug 8, 2018

    @therealkenc

    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.

  16. 23 remaining items

  17. benhillis commented on Aug 16, 2018

    @benhillis
    Member

    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:"

  18. k-y commented on Aug 16, 2018

    @k-y

    Ben Hillis (@benhillis) System Boot Time: 8/13/2018, 4:24:23 PM

  19. benhillis commented on Aug 16, 2018

    @benhillis
    Member

    Kevin Ying (@k-y) - Interesting. And if you reboot (actual reboot, not shut down) does the problem go away?

  20. k-y commented on Aug 16, 2018

    @k-y

    Ben Hillis (@benhillis) Yup. I'll look into if I can upgrade my laptop to an insiderbuild.

  21. benhillis commented on Aug 16, 2018

    @benhillis
    Member

    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.

  22. emmatyping commented on Aug 30, 2018

    @emmatyping

    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?

  23. benhillis commented on Aug 30, 2018

    @benhillis
    Member

    ethanhs - Yeah unfortunately the fix is not in skip ahead yet, but will be very soon.

  24. k-y commented on Sep 4, 2018

    @k-y

    Ah yes, I had updated to 17134 and just had the issue. Rebooting to update to 17751.

  25. whereisaaron commented on Nov 27, 2018

    @whereisaaron

    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.

  26. robcxyz commented on Dec 6, 2018

    @robcxyz

    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.

    sc stop LxssManager
    sc start LxssManager
    
  27. Yehonal commented on May 4, 2020

    @Yehonal

    my client hanged at debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

    I had to lower the MTU value. Now it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions