Search code examples
sshfirewallopensshwindows-firewall

Allow ssh protocol through win 10 firewall


I have a workstation with Win 10 on which I installed OpenSSH server. If I try to connect to it (from another machine with Win 10 using ssh in a command prompt) I see it gives the following error:

ssh: connect to host Test3 port 22: Connection timed out

On wireshark Syn packets are sent but no answer is received back. If I dissable Windows firewall on destination then connection is established.

I want to leave the firewall enabled and disable only ssh port.


Solution

  • I found on microsoft site a link which allow to do it using graphical interface. I solved my problem performing the following steps as administrator:

    • Open the Group Policy Management Console / File/ Add snap-in / Windows Defender Firewall with Advanced Security(or Windows Settings/ Windows Defender Firewall / Advanced settings).
    • Inbound Rules / Actions / New rule
    • Rule Type / Port / Next
    • TCP / Specific port: 22 / Next
    • Allow the connection / Next / Next
    • Name / Open ssh port 22 / Finish