I installed OpenSSH-server on my Windows 10 PC (probably a "home" version, not a Windows server) using the Microsoft guide. I did not change the C:/Windows/System32/OpenSSH/sshd_config_default
file (although I don't think that's relevant here anyway). I can log to the machine from a terminal on that same machine:
I have another machine running on the same LAN (both wired to the same SoHo router). From it, trying to connect to Windows 10 fails wtih:
kex_exchange_identification: Connection closed by remote host
Connection closed by 10.0.3.130 port 22
According to this answer to another similar thread, this error happens when the server closes the TCP connection during the cryptographic exchange, or something like that. So I've looked at Windows' firewall, but there is an enabled inbound rule for TCP port 22 (and, besides, if it had beed a missing rule issue, the SSH client would just timeout, not have an error in kex_exchange_identification
):
So I've tried running Wireshark on the server (10.0.3.130). It appears the server accepts the TCP handshake, then the other machine (10.0.3.10) sends some protocol SSH packet, and then the server just closes the connection:
To see what would happen, I went to Windows' Services
app and stopped the OpenSSH SSH Server
service, then tried the same thing, but the result with Wireshark is the same:
The one thing I've noticed, and that I don't quite understand, is that running netstat -ab
in an administrator PowerShell shows that port 22 has an active listener on it, even when OpenSSH is stopped (just Windows things I guess...):
So, yeah... I'm stomped at this point. Any ideas?