How to Enable OpenSSH Server in Windows 11
OpenSSH Server in Windows 11 lets you connect to your computer from another device using a safe, encrypted remote connection. This built-in tool uses Secure Shell technology to send commands and move files without needing a physical keyboard and mouse.
Windows 11 leaves this server turned off by default, so you have to add it through your system settings or PowerShell before you can start using it.
Install OpenSSH Server via Settings by going to Apps Optional features, clicking View features, searching for OpenSSH Server, selecting it, and clicking Install. Alternatively, use PowerShell with the command Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0.
How to Install OpenSSH Server
This feature can be installed using the Settings menu or the command line. Admin privileges are required for these steps.
Method 1Using Windows Settings
1. Press Win+I to open Settings .
2. Go to Apps > Optional features.
3. Click View features, then search for OpenSSH Server.
4. Select the feature and click Next, then Install.





Method 2Using PowerShell (Fastest Way)
The OpenSSH server can be installed using PowerShell by entering the command `Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0`. This command adds the OpenSSH server to your Windows 11 system. Installing the OpenSSH server makes remote access possible.
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Starting and Managing the Service
The OpenSSH Server service must be started in Windows 11 for other devices to connect to your computer. This service allows remote and secure logins. To start the OpenSSH Server service, open the Services app, find “OpenSSH SSH Server,” right-click it, and select “Start.”
Head to the Windows Services app to get the server running. Press Win + R, type `services.msc`, and hit Enter. Right-click the service name and choose "Start." To ensure the service begins automatically when Windows 11 starts, right-click "OpenSSH SSH Server" again, select "Properties," and then set the "Startup type" to "Automatic."


Run `Get-Service sshd` in PowerShell to verify the service status.
Configuration and Security
The main configuration file, `sshd_config`, is usually found at `C:\ProgramData\ssh\sshd_config`. This file can be edited to change the default port or restrict access.
How do I change the default SSH port on 🪟 Windows 11?
To change the port, open `sshd_config` in a text editor with administrator privileges. Find the line that says `#Port 22`, remove the hash (#) symbol, 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\YourUsername\.ssh\authorized_keys`. This allows logging in without needing to type a password each time.
Troubleshooting
If you cannot connect, check your Windows Firewall. The installation usually creates a rule, but you might need to confirm that 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
Setting up OpenSSH Server on Windows 11 provides a secure method for controlling your PC remotely. You can install it through Settings or PowerShell, then start the service and check your firewall. For better security, use key-based logins instead of passwords.
Was this guide helpful?
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.
how to connect ssh tunnel in cmd?
It says “Couldn’t install” 🙁 Is there a dependency? A running service maybe?
hi richard
what is the accoumd password here?
@melisa the Password is the same as you’ve set at your account on the machine to enter it locally