Shared server guidance · Question & answer

How do I inspect Windows firewall rules affecting SSH?

Read the active firewall rule together with its associated filters. The rule summary alone does not show all port and address conditions. Provider firewalls and network allowlists can impose additional restrictions outside Windows.

IntermediateWindows Server 2022 or 2025, VPS or dedicated; commands run in PowerShell on that serverWindows PowerShell 5.1 or supported PowerShell with the required Windows modules
Go to the answer

Instructions

1. Read the active SSH rule

The example name is the rule commonly created by the Microsoft OpenSSH Server feature. Your installation may use a different authorised rule.

Remote Windows PowerShell
Get-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -PolicyStore ActiveStore | Select-Object Name, Enabled, Direction, Action, Profile

ActiveStore reflects the combined active policy. Confirm that the rule applies to the current network profile.

2. Inspect its associated port filter

A rule name mentioning SSH is not proof that it permits the actual configured port.

Remote Windows PowerShell
Get-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -PolicyStore ActiveStore | Get-NetFirewallPortFilter

Check protocol and local port against the listening SSH service.

3. Review source scope and other policy layers

Inspect the rule’s address filter and the provider firewall. An additional narrow allow rule does not automatically remove a separate broad allow rule.

Remote Windows PowerShell
Get-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -PolicyStore ActiveStore | Get-NetFirewallAddressFilter

Review RemoteAddress and LocalAddress. Resolve policy mismatches through a scoped approved change while retaining a recovery console.

Check the result

  • The effective rule, port and allowed source address agree with the intended SSH access policy.
  • A connection succeeds from an authorised client and is evaluated alongside provider firewall policy.

Troubleshooting

The named rule is absent
Inspect the installation’s actual rule names instead of creating a duplicate automatically.
The Windows rule allows access but the client still fails
Check the listener, assigned port, provider firewall and source-address routing.

Official references

Use the documentation for your installed version when a flag, service name or platform feature differs.