Install OpenSSH Server and Client on Windows 11
This guide provides a straightforward walkthrough for installing and configuring both the OpenSSH Client and OpenSSH Server components on Windows 11. Whether you prefer using the graphical Windows Settings interface or fast command-line execution via PowerShell, you will learn how to enable these tools and start the SSH server service for secure remote access.
Method 1: Install OpenSSH Using Windows Settings
The graphical interface is the simplest method to add optional Windows features.
Step 1: Open Optional Features
- Open the Start Menu and click
Settings (or press
Win + I). - Navigate to System on the left menu, then select Optional features on the right pane.
Step 2: Add OpenSSH Components
- Click the View features button next to Add an optional feature.
- In the search bar, type
OpenSSH. - Select OpenSSH Client (if not already installed) and OpenSSH Server.
- Click Next, then click Install.
Windows will download and install the selected components in the background.
Method 2: Install OpenSSH Using PowerShell
PowerShell provides a quick, automated way to install both features.
Step 1: Open PowerShell as Administrator
- Right-click the Start Menu icon.
- Select Terminal (Admin) or PowerShell (Admin).
Step 2: Check Feature Status
Run the following command to check if the components are already installed:
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'Step 3: Install the Client and Server
To install the OpenSSH Client, run:
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0To install the OpenSSH Server, run:
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Both commands should return an output showing
RestartNeeded : False and
State : Installed.
Configure and Start the OpenSSH Server
After installing the OpenSSH Server, you must start the service and configure it to run automatically on system boot.
Open PowerShell as Administrator.
Set the SSH service startup type to Automatic:
Set-Service -Name sshd -StartupType 'Automatic'Start the SSH service:
Start-Service sshdVerify that the SSH server is running and listening on port 22:
Get-Service -Name sshd
Verify Firewall Configuration
The OpenSSH installation automatically creates a firewall rule. To ensure incoming connections on port 22 are permitted, run:
Get-NetFirewallRule -Name *OpenSSH-Server* | Select-Object Name, DisplayName, Enabled, DirectionIf the rule is enabled, your Windows 11 machine is ready to accept incoming SSH connections.