PowerShell / Win32-OpenSSH

Win32 port of OpenSSH
7.43k stars 760 forks source link

Disconnect after a couple of minutes if there is no new input #1583

Closed tfenster closed 4 years ago

tfenster commented 4 years ago

"OpenSSH for Windows" version ((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion) 7.7.2.1

Server OperatingSystem ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName) Windows Server 2019 Datacenter (Windows Server Core)

Client OperatingSystem Windows Version 2004 (Build 19041.172)

What is failing I can use openssh fine until I leave the terminal where it is running alone for a couple of minutes and don't interact with the session. After that I see

debug3: recv - from CB ERROR:10060, io:000002712BC823E0
debug3: send packet: type 1
debug3: send - WSASend() ERROR:10054, io:000002712BC823E0
Connection reset by 13.81.122.67 port 22

Expected output The connection to sshd keeps open

Actual output The connections breaks

Debug output from the server

psexec -s sshd.exe -ddd

PsExec v2.2 - Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals - www.sysinternals.com

debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug2: load_server_config: done config len = 251
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 251
debug3: __PROGRAMDATA__\\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: __PROGRAMDATA__\\ssh/sshd_config:76 setting Subsystem sftp      sftp-server.exe
debug3: checking syntax for 'Match Group administrators'
debug1: sshd version OpenSSH_for_Windows_7.7, LibreSSL 2.6.5
debug1: private host key #0: ssh-rsa SHA256:d/5G9fCC5M3mlFM4hh/GFvA/rYOys6CQFYOV2ZvbUEQ
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:huMdP5S2fc2jx2+87gm8sm5J5c5rOm49sN1rED6jb34
debug1: private host key #2: ssh-ed25519 SHA256:mnkvOrfv9xLp5KwR6xc7SAuEGIclH9Wej4wOLQUYV0s
debug1: rexec_argv[0]='sshd.exe'
debug1: rexec_argv[1]='-ddd'
debug2: fd 3 setting O_NONBLOCK
debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug2: fd 4 setting O_NONBLOCK
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug3: fd 5 is not O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug3: send_rexec_state: entering fd = 8 config len 251
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
Connection from 185.35.208.129 port 38276 on 10.0.3.4 port 22
debug1: Client protocol version 2.0; client software version OpenSSH_for_Windows_7.7
debug1: match: OpenSSH_for_Windows_7.7 pat OpenSSH* compat 0x04000000
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug2: fd 5 setting O_NONBLOCK
debug3: spawning "C:\\windows\\System32\\OpenSSH\\sshd.exe" "-ddd" "-y"
debug2: Network child is on pid 696
debug3: send_rexec_state: entering fd = 4 config len 251
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug3: recv_rexec_state: entering fd = 3
debug3: ssh_msg_send: type 0
debug3: ssh_msg_recv entering
debug3: ssh_msg_send: type 0
debug3: recv_rexec_state: done
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 251
debug3: preauth child monitor started
debug3: __PROGRAMDATA__\\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: __PROGRAMDATA__\\ssh/sshd_config:76 setting Subsystem sftp      sftp-server.exe
debug3: checking syntax for 'Match Group administrators'
debug1: sshd version OpenSSH_for_Windows_7.7, LibreSSL 2.6.5
debug3: ssh_msg_recv entering
debug3: ssh_msg_recv entering
debug2: fd 5 setting O_NONBLOCK
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug3: send packet: type 20 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug3: receive packet: type 20 [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug2: local server KEXINIT proposal [preauth]
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-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: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: compression ctos: none [preauth]
debug2: compression stoc: none [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: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c [preauth]
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa [preauth]
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: compression ctos: none [preauth]
debug2: compression stoc: none [preauth]
debug2: languages ctos:  [preauth]
debug2: languages stoc:  [preauth]
debug2: first_kex_follows 0  [preauth]
debug2: reserved 0  [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug3: receive packet: type 30 [preauth]
debug3: mm_key_sign entering [preauth]
debug3: mm_request_send entering: type 6 [preauth]
debug3: mm_key_sign: waiting for MONITOR_ANS_SIGN [preauth]
debug3: mm_request_receive_expect entering: type 7 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 6
debug3: mm_answer_sign
debug3: mm_answer_sign: hostkey proof signature 000002A750B7B4C0(100)
debug3: mm_request_send entering: type 7
debug2: monitor_read: 6 used once, disabling now
debug3: send packet: type 31 [preauth]
debug3: send packet: type 21 [preauth]
debug2: set_newkeys: mode 1 [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug3: send packet: type 7 [preauth]
debug3: receive packet: type 21 [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug2: set_newkeys: mode 0 [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: KEX done [preauth]
debug3: receive packet: type 5 [preauth]
debug3: send packet: type 6 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user VM-Administrator service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug3: mm_getpwnamallow entering [preauth]
debug3: mm_request_send entering: type 8 [preauth]
debug3: mm_getpwnamallow: waiting for MONITOR_ANS_PWNAM [preauth]
debug3: mm_request_receive_expect entering: type 9 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 8
debug3: mm_answer_pwnamallow
debug2: parse_server_config: config reprocess config len 251
debug3: checking match for 'Group administrators' user vm-administrator host 185.35.208.129 addr 185.35.208.129 laddr 10.0.3.4 lport 22
debug3: LsaLogonUser Succeeded (Impersonation: 0)
debug1: user vm-administrator matched group list administrators at line 84
debug3: match found
debug3: reprocess config:85 setting AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
debug3: mm_answer_pwnamallow: sending MONITOR_ANS_PWNAM: 1
debug3: mm_request_send entering: type 9
debug2: monitor_read: 8 used once, disabling now
debug2: input_userauth_request: setting up authctxt for VM-Administrator [preauth]
debug3: mm_inform_authserv entering [preauth]
debug3: mm_request_send entering: type 4 [preauth]
debug2: input_userauth_request: try method none [preauth]
debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
debug3: send packet: type 51 [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 4
debug3: mm_answer_authserv: service=ssh-connection, style=
debug2: monitor_read: 4 used once, disabling now
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user VM-Administrator service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug2: input_userauth_request: try method publickey [preauth]
debug1: userauth_pubkey: test pkalg rsa-sha2-512 pkblob RSA SHA256:R9x0YhTJk5JLUsv0CHKVPUzIxmGDMaqPN+Ob8LK+nj0 [preauth]
debug3: mm_key_allowed entering [preauth]
debug3: mm_request_send entering: type 22 [preauth]
debug3: mm_key_allowed: waiting for MONITOR_ANS_KEYALLOWED [preauth]
debug3: mm_request_receive_expect entering: type 23 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 22
debug3: mm_answer_keyallowed entering
debug3: mm_answer_keyallowed: key_from_blob: 000002A750B7B4C0
debug1: trying public key file __PROGRAMDATA__/ssh/administrators_authorized_keys
debug3: Failed to open file:C:/ProgramData/ssh/administrators_authorized_keys error:2
debug1: Could not open authorized keys '__PROGRAMDATA__/ssh/administrators_authorized_keys': No such file or directory
debug3: mm_answer_keyallowed: publickey authentication test: RSA key is not allowed
Failed publickey for VM-Administrator from 185.35.208.129 port 38276 ssh2: RSA SHA256:R9x0YhTJk5JLUsv0CHKVPUzIxmGDMaqPN+Ob8LK+nj0
debug3: mm_request_send entering: type 23
debug2: userauth_pubkey: authenticated 0 pkalg rsa-sha2-512 [preauth]
debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
debug3: send packet: type 51 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user VM-Administrator service ssh-connection method keyboard-interactive [preauth]
debug1: attempt 2 failures 1 [preauth]
debug2: input_userauth_request: try method keyboard-interactive [preauth]
debug1: keyboard-interactive devs  [preauth]
debug1: auth2_challenge: user=VM-Administrator devs= [preauth]
debug1: kbdint_alloc: devices '' [preauth]
debug2: auth2_challenge_start: devices  [preauth]
debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
debug3: send packet: type 51 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user VM-Administrator service ssh-connection method password [preauth]
debug1: attempt 3 failures 2 [preauth]
debug2: input_userauth_request: try method password [preauth]
debug3: mm_auth_password entering [preauth]
debug3: mm_request_send entering: type 12 [preauth]
debug3: mm_auth_password: waiting for MONITOR_ANS_AUTHPASSWORD [preauth]
debug3: mm_request_receive_expect entering: type 13 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 12
debug3: mm_answer_authpassword: sending result 1
debug3: mm_request_send entering: type 13
Accepted password for VM-Administrator from 185.35.208.129 port 38276 ssh2
debug1: monitor_child_preauth: VM-Administrator has been authenticated by privileged process
debug3: mm_get_keystate: Waiting for new keys
debug3: mm_request_receive_expect entering: type 26
debug3: mm_request_receive entering
debug3: mm_get_keystate: GOT new keys
debug3: mm_auth_password: user authenticated [preauth]
debug3: send packet: type 52 [preauth]
debug3: mm_request_send entering: type 26 [preauth]
debug3: mm_send_keystate: Finished sending state [preauth]
debug3: ReadFileEx() ERROR:109, io:000002A750B70500
debug3: read - no more data, io:000002A750B70500
debug1: monitor_read_log: child log fd closed
debug3: spawning "C:\\windows\\System32\\OpenSSH\\sshd.exe" "-ddd" "-z"
User child is on pid 5712
debug3: send_rexec_state: entering fd = 6 config len 251
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug3: recv_rexec_state: entering fd = 3
debug3: ssh_msg_send: type 0
debug3: ssh_msg_recv entering
debug3: ssh_msg_send: type 0
debug3: recv_rexec_state: done
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 251
debug3: ssh_msg_send: type 0
debug3: __PROGRAMDATA__\\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: ssh_msg_send: type 0
debug3: __PROGRAMDATA__\\ssh/sshd_config:76 setting Subsystem sftp      sftp-server.exe
debug3: ssh_msg_send: type 0
debug3: checking syntax for 'Match Group administrators'
debug1: sshd version OpenSSH_for_Windows_7.7, LibreSSL 2.6.5
debug3: ssh_msg_recv entering
debug3: ssh_msg_recv entering
debug2: fd 4 setting O_NONBLOCK
debug3: ssh_msg_recv entering
debug2: parse_server_config: config reprocess config len 251
debug3: checking match for 'Group administrators' user vm-administrator host 185.35.208.129 addr 185.35.208.129 laddr 10.0.3.4 lport 22
debug3: get_user_token - i am running as vm-administrator, returning process token
debug1: user n matched group list administrators at line 84
debug3: match found
debug3: reprocess config:85 setting AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
debug3: ssh_msg_recv entering
debug3: monitor_apply_keystate: packet_set_state
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
debug3: ssh_packet_set_state: done
debug3: ssh_msg_recv entering
debug3: notify_hostkeys: key 0: ssh-rsa SHA256:d/5G9fCC5M3mlFM4hh/GFvA/rYOys6CQFYOV2ZvbUEQ
debug3: notify_hostkeys: key 1: ecdsa-sha2-nistp256 SHA256:huMdP5S2fc2jx2+87gm8sm5J5c5rOm49sN1rED6jb34
debug3: notify_hostkeys: key 2: ssh-ed25519 SHA256:mnkvOrfv9xLp5KwR6xc7SAuEGIclH9Wej4wOLQUYV0s
debug3: notify_hostkeys: sent 3 hostkeys
debug3: send packet: type 80
debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Entering interactive session for SSH2.
debug2: fd 7 setting O_NONBLOCK
debug2: fd 8 setting O_NONBLOCK
debug1: server_init_dispatch
debug3: receive packet: type 90
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)
debug3: session_unused: session id 0 unused
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
debug3: send packet: type 91
debug3: receive packet: type 80
debug1: server_input_global_request: rtype no-more-sessions@openssh.com want_reply 0
debug3: receive packet: type 98
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.
debug3: fd 9 is not O_NONBLOCK
debug3: fd 10 is not O_NONBLOCK
debug1: session_pty_req: session 0 alloc windows-pty
debug3: send packet: type 99
debug3: receive packet: type 98
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 windows-pty for vm-administrator from 185.35.208.129 port 38276 id 0
debug2: fd 11 setting O_NONBLOCK
debug2: fd 12 setting O_NONBLOCK
debug2: fd 13 setting O_NONBLOCK
debug2: fd 14 setting O_NONBLOCK
debug2: fd 15 setting O_NONBLOCK
debug2: fd 16 setting O_NONBLOCK
debug1: Executing command: "c:\\windows\\system32\\cmd.exe" with pty
debug3: pty commandline: C:\\windows\\system32\\conhost.exe --headless --width 224 --height 50 --signal 0x1b4 -- "c:\\windows\\system32\\cmd.exe"
debug2: fd 4 setting TCP_NODELAY
debug2: channel 0: rfd 13 isatty
debug3: fd 13 is O_NONBLOCK
debug3: fd 12 is O_NONBLOCK
debug3: send packet: type 99

No new debug output happens when the client disconnects

Debug output from the client

ssh -l VM-Administrator -vvv bare3-swarm.westeurope.cloudapp.azure.com
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\tfenster8982/.ssh/config
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolving "bare3-swarm.westeurope.cloudapp.azure.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to bare3-swarm.westeurope.cloudapp.azure.com [13.81.122.67] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_rsa type 0
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_rsa-cert error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_rsa-cert.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_rsa-cert type -1
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_dsa error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_dsa.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_dsa type -1
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_dsa-cert error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_dsa-cert.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_dsa-cert type -1
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_ecdsa error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_ecdsa.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_ecdsa type -1
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_ecdsa-cert error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_ecdsa-cert.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_ecdsa-cert type -1
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_ed25519 error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_ed25519.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_ed25519 type -1
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_ed25519-cert error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_ed25519-cert.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_ed25519-cert type -1
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_xmss error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_xmss.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_xmss type -1
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_xmss-cert error:2
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/id_xmss-cert.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\tfenster8982/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_7.7
debug1: match: OpenSSH_for_Windows_7.7 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to bare3-swarm.westeurope.cloudapp.azure.com:22 as 'VM-Administrator'
debug3: hostkeys_foreach: reading file "C:\\Users\\tfenster8982/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\\Users\\tfenster8982/.ssh/known_hosts:12
debug3: load_hostkeys: loaded 1 keys from bare3-swarm.westeurope.cloudapp.azure.com
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nis
tp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512
,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-
cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,h
mac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,h
mac-sha1
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512
,diffie-hellman-group14-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: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,h
mac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,h
mac-sha1
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:huMdP5S2fc2jx2+87gm8sm5J5c5rOm49sN1rED6jb34
debug3: hostkeys_foreach: reading file "C:\\Users\\tfenster8982/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\\Users\\tfenster8982/.ssh/known_hosts:12
debug3: load_hostkeys: loaded 1 keys from bare3-swarm.westeurope.cloudapp.azure.com
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug3: hostkeys_foreach: reading file "C:\\Users\\tfenster8982/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\\Users\\tfenster8982/.ssh/known_hosts:12
debug3: load_hostkeys: loaded 1 keys from 13.81.122.67
debug3: Failed to open file:C:/Users/tfenster8982/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug1: Host 'bare3-swarm.westeurope.cloudapp.azure.com' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\tfenster8982/.ssh/known_hosts:12
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: C:\\Users\\tfenster8982/.ssh/id_rsa (000002712BC202F0)
debug2: key: C:\\Users\\tfenster8982/.ssh/id_dsa (0000000000000000)
debug2: key: C:\\Users\\tfenster8982/.ssh/id_ecdsa (0000000000000000)
debug2: key: C:\\Users\\tfenster8982/.ssh/id_ed25519 (0000000000000000)
debug2: key: C:\\Users\\tfenster8982/.ssh/id_xmss (0000000000000000)
debug3: send packet: type 5
debug3: receive packet: type 7
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>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:R9x0YhTJk5JLUsv0CHKVPUzIxmGDMaqPN+Ob8LK+nj0 C:\\Users\\tfenster8982/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: C:\\Users\\tfenster8982/.ssh/id_dsa
debug3: no such identity: C:\\Users\\tfenster8982/.ssh/id_dsa: No such file or directory
debug1: Trying private key: C:\\Users\\tfenster8982/.ssh/id_ecdsa
debug3: no such identity: C:\\Users\\tfenster8982/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: C:\\Users\\tfenster8982/.ssh/id_ed25519
debug3: no such identity: C:\\Users\\tfenster8982/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: C:\\Users\\tfenster8982/.ssh/id_xmss
debug3: no such identity: C:\\Users\\tfenster8982/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
Microsoft Windows [Version 10.0.17763.1098]
(c) 2018 Microsoft Corporation. All rights reserved.

vm-administrator@mgr C:\Users\vm-administrator>dir
 Volume in drive C is Windows
 Volume Serial Number is 0CFC-A165

 Directory of C:\Users\vm-administrator

04/08/2020  03:18 PM    <DIR>          .
04/08/2020  03:18 PM    <DIR>          ..
04/08/2020  03:18 PM    <DIR>          3D Objects
04/08/2020  03:18 PM    <DIR>          Contacts
04/08/2020  03:18 PM    <DIR>          Desktop
04/08/2020  03:18 PM    <DIR>          Documents
04/08/2020  03:18 PM    <DIR>          Downloads
04/08/2020  03:18 PM    <DIR>          Favorites
04/08/2020  03:18 PM    <DIR>          Links
04/08/2020  03:18 PM    <DIR>          Music
04/08/2020  12:25 PM    <DIR>          my
04/08/2020  03:18 PM    <DIR>          Pictures
04/08/2020  03:18 PM    <DIR>          Saved Games
04/08/2020  03:18 PM    <DIR>          Searches
04/08/2020  03:18 PM    <DIR>          Videos
04/08/2020  12:25 PM             1,130 _viminfo
               1 File(s)          1,130 bytes
              15 Dir(s)  109,240,524,800 bytes free

vm-administrator@mgr C:\Users\vm-administrator>debug3: recv - from CB ERROR:10060, io:000002712BC823E0
debug3: send packet: type 1
debug3: send - WSASend() ERROR:10054, io:000002712BC823E0
Connection reset by 13.81.122.67 port 22
debug3: Successfully set console output code page from 65001 to 850
debug3: Successfully set console input code page from 65001 to 850
bagajjal commented 4 years ago

I think it's specific to your environment. SSHD process is being killed by other process.

I just tried with V8.1, I didn't see any issue. Please get V8.1 and try in your environment to confirm this. image

tfenster commented 4 years ago

I've tried with 8.0.1 and the problem still exists.

SSHD process is being killed by other process.

Do you mean to say that the server side is killed? That is actually not true, I can immediately reconnect after the error happens

NoMoreFood commented 4 years ago

@tfenster Not saying that @bagajjal is definitely correct, but some pieces of security software (for example) will forcefully kill inactive connections. Whenever you connect you get your own dedicated sshd.exe process that hosts your sessions so being able to immediately reconnect is not necessary mean something isn't killing the process associated with your session.