How to Enable OpenSSH Server in Windows 11
Enabling OpenSSH Server in Windows 11 lets you securely manage your PC from another computer using an encrypted connection.
OpenSSH Server is a tool that allows secure remote access, similar to how you might connect to a server. It uses SSH (Secure Shell) to create a private tunnel for your commands and file transfers.
This feature isn’t turned on automatically in Windows 11. You need to install it yourself using Windows Settings or PowerShell.
Once installed, your Windows 11 computer can accept secure SSH connections. This is very handy for managing your PC when you’re not right in front of 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 the 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.





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.”
The OpenSSH SSH Server service in Windows 11 permits secure remote login. Find “OpenSSH SSH Server” in the Services app to start this service. 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.”


The status can be verified anytime by running Get-Service sshd in PowerShell.
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