Connection reset by ::1 port 22 (Windows 10 + PowerShell/cmd + OpenSSH)

Question:

I’m a host Windows 10 (version 20H2, build 19042.746), with WSL2 installed (like here: https://learn.microsoft.com/en-us/windows/wsl/install-win10).

After I installed the OpenSSH (like here: https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse and https://www.hanselman.com/blog/the-easy-way-how-to-ssh-into-bash-and-wsl2-on-windows-10-from-an-external-machine), with these commands in PowerShell as admin:

I checked that the Windows Firewall includes service OpenSSH as an active and open Inbound Rule.

I checked with telnet too:

Until here seems all is ok!

Now the problem happens, running the command also in PowerShell (or in cmd):

Did anyone have the same problem (running in: Windows 10 + PowerShell/cmd + OpenSSH)?

Does anyone know why this problem happened?

Does anyone know how to solve this problem?

Thanks!

============= MORE INFOS =============

Follow another command to debug:

The __PROGRAMDATA__ seems to refer to Windows environment variable %PROGRAMDATA%, that point to C:\ProgramData.

Follow the content from sshd config:

Answer:

I was experiencing same issue and fixed. Need to move extracted Open-SSH folder to Program Files and it works properly.

Source:

Connection reset by ::1 port 22 (Windows 10 + PowerShell/cmd + OpenSSH) by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply