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
"OpenSSH for Windows" version ((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
8.0.0.0 Server OperatingSystem ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
OpenSSH_for_Windows_8.0p1, LibreSSL 2.6.5
Client OperatingSystem
Windows 10
What is failing
Unable to establish SSH connection. It was previously working.
Expected output
An SSH connection followed by a login prompt.
Actual output Actual output
SERVER:
C:\Program Files\OpenSSH-Win64>sshd.exe -ddd
debug2: load_server_config: filename PROGRAMDATA\ssh/sshd_config
debug2: load_server_config: done config len = 300
debug2: parse_server_config: config PROGRAMDATA\ssh/sshd_config len 300
debug3: PROGRAMDATA\ssh/sshd_config:9 setting Port 2022
debug3: PROGRAMDATA\ssh/sshd_config:30 setting StrictModes no
debug3: PROGRAMDATA\ssh/sshd_config:34 setting PubkeyAuthentication yes
debug3: PROGRAMDATA\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: PROGRAMDATA\ssh/sshd_config:79 setting Subsystem sftp sftp-server.exe
debug3: checking syntax for 'Match Group administrators'
debug1: sshd version OpenSSH_for_Windows_8.0, LibreSSL 2.6.5
debug1: private host key #0: ssh-rsa SHA256:HPCHuY/56QDTN2RKc/gEOgkkV/g3J4eB8cQBgGRXfAg
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:JTodMnrxAaMDRa71DuqFKcoE2hYhJTvfySSAA9hwm94
debug1: private host key #2: ssh-ed25519 SHA256:rnJqrSvOEwG6+b2sDVv5Ulsf+SJnCMk0IBMPpx6YQw0
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 2022 on ::.
Server listening on :: port 2022.
debug2: fd 4 setting O_NONBLOCK
debug1: Bind to port 2022 on 0.0.0.0.
Server listening on 0.0.0.0 port 2022.
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 300
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
Connection from -Client IP- port 50740 on -OpenSSH Server IP- port 2022
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug2: fd 5 setting O_NONBLOCK
debug3: spawning "C:\Program Files\OpenSSH-Win64\sshd.exe" -ddd -y
debug2: Network child is on pid 7024
debug3: send_rexec_state: entering fd = 4 config len 300
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug3: ssh_msg_send: type 0
debug3: ssh_msg_send: type 0
debug3: preauth child monitor started
debug3: recv_rexec_state: entering fd = 3
debug3: ssh_msg_recv entering
debug3: recv_rexec_state: done
debug2: parse_server_config: config PROGRAMDATA\ssh/sshd_config len 300
debug3: PROGRAMDATA\ssh/sshd_config:9 setting Port 2022
debug3: PROGRAMDATA\ssh/sshd_config:30 setting StrictModes no
debug3: PROGRAMDATA\ssh/sshd_config:34 setting PubkeyAuthentication yes
debug3: PROGRAMDATA\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: PROGRAMDATA\ssh/sshd_config:79 setting Subsystem sftp sftp-server.exe
debug3: checking syntax for 'Match Group administrators'
debug1: sshd version OpenSSH_for_Windows_8.0, LibreSSL 2.6.5
debug3: recv_hostkeys_state: entering fd = 3
debug3: ssh_msg_recv entering
debug3: recv_hostkeys_state: done
WSADuplicateSocket failed, WSALastError: 10038
debug3: w32_fcntl ERROR: bad fd: -1
debug3: w32_fcntl ERROR: bad fd: -1
debug3: w32_getpeername ERROR: bad fd: -1
debug3: recv_idexch_state: entering fd = 3
debug3: ssh_msg_recv entering
debug3: recv_idexch_state: done
debug3: w32_fcntl ERROR: bad fd: -1
fcntl(-1, F_GETFL): Bad file descriptor
debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug3: send packet: type 20 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug3: w32_write ERROR: bad fd: -1 [preauth]
ssh_dispatch_run_fatal: Connection from UNKNOWN port 65535: Bad file descriptor [preauth]
debug1: do_cleanup [preauth]
debug3: ReadFileEx() ERROR:109, io:000002DD0B612D20
debug1: monitor_read_log: child log fd closed
debug3: mm_request_receive entering
debug1: do_cleanup
debug1: Killing privsep child 7024
CLIENT:
ssh -p 2022 -vvv -Username-@-OpenSSH Server IP-
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "-OpenSSH Server IP-" port 2022
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to -OpenSSH Server IP- [-OpenSSH Server IP-] port 2022.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.0
debug1: match: OpenSSH_for_Windows_8.0 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to -OpenSSH Server IP-:2022 as '-Username-'
debug3: put_host_port: [-OpenSSH Server IP-]:2022
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /root/.ssh/known_hosts:856
debug3: load_hostkeys: loaded 1 keys from [-OpenSSH Server IP-]:2022
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
Connection reset by -OpenSSH Server IP- port 2022
The text was updated successfully, but these errors were encountered:
We think this is related to OpenTextSocks being installed and 'taking over' winsock (HUMsocks.dll), but believe this issue is with OpenSSH currently as other application are working ok with OpenTextSocks installed. WSADuplicateSocket failed, WSALastError: 1003 showing that winsocks has failed somehow. Any help appreciated.
OpenTextSocks have provided a workaround that works. This forces programs to bypass OpenTextSocks - So we can force sshd to be ignored.
In a command window as admin
cd C:\Program Files\Open Text\SOCKS Client
HumCSCConsole.exe -F "C:\Windows\System32\OpenSSH\sshd.exe"
This adds a registry entry to HKLM\System\CurrentControlSet\services\WinSock2\Parameters\AppId_Catalog\ and into a subkey appropriate for the socks client.
Restart SSHD and it will work again.
A fix is still required to avoid this work around.
Troubleshooting steps
https://github.com/PowerShell/Win32-OpenSSH/wiki/Troubleshooting-Steps
Terminal issue? please go through wiki
https://github.com/PowerShell/Win32-OpenSSH/wiki/TTY-PTY-support-in-Windows-OpenSSH
Please answer the following
"OpenSSH for Windows" version
((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
8.0.0.0
Server OperatingSystem
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
OpenSSH_for_Windows_8.0p1, LibreSSL 2.6.5
Client OperatingSystem
Windows 10
What is failing
Unable to establish SSH connection. It was previously working.
Expected output
An SSH connection followed by a login prompt.
Actual output
Actual output
SERVER:
C:\Program Files\OpenSSH-Win64>sshd.exe -ddd
debug2: load_server_config: filename PROGRAMDATA\ssh/sshd_config
debug2: load_server_config: done config len = 300
debug2: parse_server_config: config PROGRAMDATA\ssh/sshd_config len 300
debug3: PROGRAMDATA\ssh/sshd_config:9 setting Port 2022
debug3: PROGRAMDATA\ssh/sshd_config:30 setting StrictModes no
debug3: PROGRAMDATA\ssh/sshd_config:34 setting PubkeyAuthentication yes
debug3: PROGRAMDATA\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: PROGRAMDATA\ssh/sshd_config:79 setting Subsystem sftp sftp-server.exe
debug3: checking syntax for 'Match Group administrators'
debug1: sshd version OpenSSH_for_Windows_8.0, LibreSSL 2.6.5
debug1: private host key #0: ssh-rsa SHA256:HPCHuY/56QDTN2RKc/gEOgkkV/g3J4eB8cQBgGRXfAg
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:JTodMnrxAaMDRa71DuqFKcoE2hYhJTvfySSAA9hwm94
debug1: private host key #2: ssh-ed25519 SHA256:rnJqrSvOEwG6+b2sDVv5Ulsf+SJnCMk0IBMPpx6YQw0
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 2022 on ::.
Server listening on :: port 2022.
debug2: fd 4 setting O_NONBLOCK
debug1: Bind to port 2022 on 0.0.0.0.
Server listening on 0.0.0.0 port 2022.
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 300
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
Connection from -Client IP- port 50740 on -OpenSSH Server IP- port 2022
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug2: fd 5 setting O_NONBLOCK
debug3: spawning "C:\Program Files\OpenSSH-Win64\sshd.exe" -ddd -y
debug2: Network child is on pid 7024
debug3: send_rexec_state: entering fd = 4 config len 300
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug3: ssh_msg_send: type 0
debug3: ssh_msg_send: type 0
debug3: preauth child monitor started
debug3: recv_rexec_state: entering fd = 3
debug3: ssh_msg_recv entering
debug3: recv_rexec_state: done
debug2: parse_server_config: config PROGRAMDATA\ssh/sshd_config len 300
debug3: PROGRAMDATA\ssh/sshd_config:9 setting Port 2022
debug3: PROGRAMDATA\ssh/sshd_config:30 setting StrictModes no
debug3: PROGRAMDATA\ssh/sshd_config:34 setting PubkeyAuthentication yes
debug3: PROGRAMDATA\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: PROGRAMDATA\ssh/sshd_config:79 setting Subsystem sftp sftp-server.exe
debug3: checking syntax for 'Match Group administrators'
debug1: sshd version OpenSSH_for_Windows_8.0, LibreSSL 2.6.5
debug3: recv_hostkeys_state: entering fd = 3
debug3: ssh_msg_recv entering
debug3: recv_hostkeys_state: done
WSADuplicateSocket failed, WSALastError: 10038
debug3: w32_fcntl ERROR: bad fd: -1
debug3: w32_fcntl ERROR: bad fd: -1
debug3: w32_getpeername ERROR: bad fd: -1
debug3: recv_idexch_state: entering fd = 3
debug3: ssh_msg_recv entering
debug3: recv_idexch_state: done
debug3: w32_fcntl ERROR: bad fd: -1
fcntl(-1, F_GETFL): Bad file descriptor
debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug3: send packet: type 20 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug3: w32_write ERROR: bad fd: -1 [preauth]
ssh_dispatch_run_fatal: Connection from UNKNOWN port 65535: Bad file descriptor [preauth]
debug1: do_cleanup [preauth]
debug3: ReadFileEx() ERROR:109, io:000002DD0B612D20
debug1: monitor_read_log: child log fd closed
debug3: mm_request_receive entering
debug1: do_cleanup
debug1: Killing privsep child 7024
CLIENT:
ssh -p 2022 -vvv -Username-@-OpenSSH Server IP-
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "-OpenSSH Server IP-" port 2022
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to -OpenSSH Server IP- [-OpenSSH Server IP-] port 2022.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.0
debug1: match: OpenSSH_for_Windows_8.0 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to -OpenSSH Server IP-:2022 as '-Username-'
debug3: put_host_port: [-OpenSSH Server IP-]:2022
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /root/.ssh/known_hosts:856
debug3: load_hostkeys: loaded 1 keys from [-OpenSSH Server IP-]:2022
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
Connection reset by -OpenSSH Server IP- port 2022
The text was updated successfully, but these errors were encountered: