How to Enable OpenSSH Server in Windows 11

Richard
Written by
Richard
Jul 27, 2021 Updated Apr 28, 2026 3 min read

Windows 11 includes a powerful tool called OpenSSH Server. It allows you to connect to your computer securely from another device. Think of it as a private tunnel for remote work.

Why use it? It provides a secure, encrypted way to manage your files and settings from anywhere.

What happens when you set it up? Your computer starts listening for incoming connections, allowing you to run commands remotely as if you were sitting right in front of your screen.

Is OpenSSH Server enabled by default on Windows 11?

No, OpenSSH Server is not enabled by default on Windows 11. While the feature is built into the operating system, you must manually install it through the Optional Features menu or via PowerShell before it can be used for remote connections.

How to Install OpenSSH Server

You can install this feature using the Settings menu or the command line. Admin privileges are required for these steps.

Method 1: Using Windows Settings

1. Press Windows key + I to open Settings.
2. Go to Apps > Optional features.
3. Click View features and search for OpenSSH Server.
4. Select it and click Install.

Windows 11 Apps section in Optional Features
Windows 11 interface for adding Optional Features
OpenSSH Server installation process in Windows 11
Completion screen for OpenSSH Server installation

Method 2: Using PowerShell (Fastest Way)

You can install the server instantly using PowerShell. Open PowerShell as an administrator and run this command:

💻Code
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Starting and Managing the Service

After installation, you must start the service. Admin privileges are required.

1. Open the Services app from the Start menu.
2. Find OpenSSH SSH Server in the list.
3. Right-click it and select Start.
4. To ensure it starts automatically, right-click it, select Properties, and change Startup type to Automatic.

Windows 11 Services search results for OpenSSH
Starting OpenSSH SSH Server in Windows 11

You can verify the status anytime by running Get-Service sshd in PowerShell.

Configuration and Security

The main configuration file is located at C:\ProgramData\ssh\sshd_config. You can edit this file to change the default port or restrict access.

How do I change the default SSH port on Windows 11?

To change the port, open C:\ProgramData\ssh\sshd_config in a text editor as an administrator. Find the line that says #Port 22, remove the #, and change 22 to your desired port number. Save the file and restart the OpenSSH SSH Server service in the Services app.

Setting up Key-Based Authentication

Passwords can be guessed. Using an SSH key pair is much safer. You generate a public and private key, then place the public key in C:\Users\username\.ssh\authorized_keys. This allows you to log in without typing a password every time.

Troubleshooting

If you cannot connect, check your Windows Firewall. The installation usually creates a rule, but you may need to ensure port 22 (or your custom port) is open. Use the command netsh advfirewall firewall show rule name=all to verify.

How do I uninstall OpenSSH Server completely?

To uninstall, go to Settings > Apps > Optional features. Find OpenSSH Server in the list of installed features, click the arrow next to it, and select Uninstall. This will remove the service and all associated files from your system.

Summary

OpenSSH Server is a secure way to manage your Windows 11 computer remotely. You can install it via Settings or PowerShell. Remember to start the service in the Services console and configure your firewall. For maximum security, use key-based authentication instead of passwords. For more details, visit the official Microsoft OpenSSH documentation.” }

Was this guide helpful?

Tags: #Windows 11
Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

0 Comments

  • Hariharan

    how to connect ssh tunnel in cmd?

    Reply
  • It says “Couldn’t install” 🙁 Is there a dependency? A running service maybe?

    Reply
  • hi richard
    what is the accoumd password here?

    Reply
  • EselDompteur

    @melisa the Password is the same as you’ve set at your account on the machine to enter it locally

    Reply

Leave a Comment

Your email address will not be published. Required fields are marked *

Exit mobile version