How To Install OpenSSH Server On Windows 11

If you’ve ever needed to connect remotely to your Windows 11 PC using SSH, you’ll be glad to know that Microsoft now includes OpenSSH Server as an optional feature. This allows you to use SSH (Secure Shell) — a secure, encrypted protocol — to remotely access your system’s command line just like you would on a Linux or macOS device.

In this guide, we’ll walk you through everything you need to know about installing, enabling, and using OpenSSH Server on Windows 11. By the end, you’ll be able to connect to your Windows machine securely using any SSH client.

What Is OpenSSH Server?

OpenSSH (Open Secure Shell) is an open-source implementation of the SSH protocol, commonly used for secure remote access and file transfers.

It provides both:

  • OpenSSH Client: lets you connect to other systems.
  • OpenSSH Server: lets others connect to your system.

Windows 11 includes both as optional features — but you’ll need to enable them manually if you want to use SSH for remote access or automation.

Why Use OpenSSH Server on Windows 11?

Here are a few practical reasons to enable it:

  • Securely connect to your PC over the network using SSH.
  • Manage files, run commands, or administer Windows remotely.
  • Set up automated scripts or remote build environments.
  • Use Git, VS Code Remote SSH, or PowerShell Remoting over SSH.

How to Check if OpenSSH Is Already Installed

Before installing, check whether OpenSSH is already enabled on your system.

1. Open Windows PowerShell as Administrator.

2. Run this command:

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

3. You’ll see something like this:

Name  : OpenSSH.Server~~~~0.0.1.0
State : NotPresent
Name  : OpenSSH.Client~~~~0.0.1.0
State : Installed

If the server shows NotPresent, it means you need to install it manually.

How to Install OpenSSH Server on Windows 11

There are two main ways to install OpenSSH Server — using Settings or PowerShell.

Method 1: Install OpenSSH Server via Settings

  1. Press Win + I to open Settings.
  2. Go to System → Optional features.
  3. Click View features next to Add an optional feature.
  4. Search for OpenSSH Server.
  5. Check the box and click Next → Install.
  6. Wait for the installation to complete.

Once done, OpenSSH Server will be installed, but you’ll need to start and enable it manually.

Method 2: Install OpenSSH Server Using PowerShell

If you prefer the command line, this is faster.

  1. Open PowerShell as Administrator.
  2. Run: Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
  3. Wait for the installation to complete — it’ll take a few minutes.

To verify, type:

Get-Service -Name sshd

If it returns service details, OpenSSH Server is installed.

Enable and Start OpenSSH Server

After installing, you need to start the SSH service and make it run automatically at startup.

Run these commands in PowerShell (Admin):

Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'

Now the SSH server will start every time you boot your PC.

To confirm it’s running, type:

Get-Service sshd

You should see:

Status   Name               DisplayName
------   ----               -----------
Running  sshd               OpenSSH SSH Server

Allow OpenSSH Through Windows Firewall

If the firewall blocks incoming SSH connections, remote devices won’t be able to connect.

Run this command in PowerShell:

New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22

This opens port 22 (the default SSH port) for incoming connections.

How to Connect to Your Windows 11 PC via SSH

Once OpenSSH Server is running, you can connect from another computer on the same network.

From Linux, macOS, or another Windows PC, open a terminal or PowerShell and run:

ssh username@hostname

Replace:

  • username → your Windows account name.
  • hostname → your PC’s name or local IP address.

Example:

ssh ajoy@192.168.1.100

If prompted, type yes to trust the host key, then enter your password. You’ll now have secure shell access to your Windows 11 command line.

Optional: Configure SSH Key Authentication

For added security, you can set up SSH key-based login:

  1. On the client PC, generate an SSH key: ssh-keygen
  2. Copy the public key to your Windows PC under: C:\Users\<yourusername>\.ssh\authorized_keys
  3. Restart the SSH service: Restart-Service sshd

You can now connect without entering your password each time.

Conclusion

Installing OpenSSH Server on Windows 11 gives you the same remote access flexibility that Linux and macOS users have enjoyed for years. Once configured, you can securely log in, run commands, and even automate administrative tasks over the network.

Whether you’re setting up a development environment, managing a headless system, or transferring files securely, OpenSSH is a lightweight and powerful solution built right into Windows 11.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.