Manual installation guide for OpenSSH Server on Windows 11

Manual

Manual installation guide for OpenSSH Server on Windows 11

How to install the OpenSSH server on Windows 11 from the official Microsoft / PowerShell binaries published on GitHub, without relying on the Windows component store.

This guide describes the manual installation procedure for the OpenSSH server on Windows 11 using the official Microsoft / PowerShell binaries published on GitHub. This method is the ideal alternative when the Windows component store (WinSxS / DISM) throws errors such as «The component store has been corrupted» or «The source files could not be found».

⚠️ Prerequisite: every command described in this document must be run in a PowerShell console opened as Administrator.

Step 1 · Download and extract the binaries

Download the latest release of OpenSSH-Win64 from the official GitHub repository and extract the files into C:\Program Files\OpenSSH:

$url = "https://github.com/PowerShell/Win32-OpenSSH/releases/latest/download/OpenSSH-Win64.zip"
Invoke-WebRequest -Uri $url -OutFile "$env:TEMP\OpenSSH.zip"
Expand-Archive -Path "$env:TEMP\OpenSSH.zip" -DestinationPath "$env:ProgramFiles" -Force
Rename-Item -Path "$env:ProgramFiles\OpenSSH-Win64" -NewName "OpenSSH" -Force -ErrorAction SilentlyContinue

Step 2 · Register the service and fix permissions

Enter the installation directory, register the sshd system service and repair the permissions of the host key files:

Set-Location -Path "$env:ProgramFiles\OpenSSH"
powershell.exe -ExecutionPolicy Bypass -File .\install-sshd.ps1
powershell.exe -ExecutionPolicy Bypass -File .\FixHostFilePermissions.ps1

💡 Note: if the FixHostFilePermissions.ps1 script asks for interactive confirmation, press Y or A to accept.

Step 3 · Start the service and open the firewall

Configure the sshd service to start automatically with the system, start it, and create the Windows Firewall rule to allow inbound traffic on port 22:

Set-Service -Name sshd -StartupType 'Automatic'
Start-Service sshd
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -ErrorAction SilentlyContinue

Step 4 · Check the status

To verify that the SSH server is active and running correctly:

Get-Service sshd

The output should show the Running state.

Optional configuration · Change the default shell to PowerShell

By default, connecting to Windows over SSH opens cmd.exe. If you prefer PowerShell as the default shell, run this command to write to the Windows registry:

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

Connecting from another machine

To reach the server from a remote SSH client:

ssh windows_user@MACHINE_IP

🔒 Keep in mind that exposing port 22 on the local network or the Internet means you should harden security: use strong passwords or, better still, public-key authentication, and where possible restrict access through the firewall to trusted machines.

Scroll to Top