Skip to content
Follow
Windows

How to Enable OpenSSH Server in Windows 11

Richard
Written by
Richard
Updated 6 min read
How to Enable OpenSSH Server in Windows 11
How to Enable OpenSSH Server in Windows 11

OpenSSH Server in Windows 11 lets you connect to your PC from another device over a secure, encrypted network connection. It uses Secure Shell (SSH), so you can run commands and move files remotely without sitting at the machine’s keyboard and mouse.

Advertisement

Windows 11 leaves the server turned off by default to save system resources. It is an optional feature on both Home and Pro, so the steps are the same on either edition. You can turn it on in under 3 minutes through Settings or PowerShell (a command-line tool for system tasks). The feature is downloaded from Microsoft, so the PC needs an internet connection during installation.

⚡ Quick Answer

To turn on OpenSSH Server in Windows 11, open Settings , go to System Optional features, select View features, search for OpenSSH Server, tick it, then click Next and Install. Installing does not start the server, so you still need to start the OpenSSH SSH Server service in services.msc. Admin rights are required.

Advertisement

How to Install OpenSSH Server

You can install the feature from the Settings app or from the command line. Admin privileges are required for either method. If you are signed in with a standard account, Windows will ask for an administrator password. Installing the feature does not turn the server on. You still have to start the service, which is covered further down.

The numbered steps below cover the whole process: installing from Settings (steps 1 to 8), then starting the service and setting it to run automatically (steps 9 to 16). If you would rather install from PowerShell, use that method in place of steps 1 to 8 and carry on at step 9.

Method 1Using Windows Settings

These steps install and start OpenSSH Server in Windows 11 from Settings.

Advertisement
  1. Press Win+I. This opens Settings.
  2. Go to System Optional features On older Windows 11 builds (21H2 and 22H2) this page is under Apps Optional features instead. You should see a list of the optional features already installed.
  3. Click View features. It sits next to the option to add an optional feature. A window opens with a search box .
  4. Search for OpenSSH Server. The matching feature appears in the results.
  5. Tick the check box next to the result. Make sure you pick the server, not the client, which is usually already installed.
  6. Click Next. Windows shows a summary of what you are about to add.
  7. Click Install. Some newer builds label this last button Add.
  8. Wait for the download to finish. The feature then appears in your installed features list. No restart is normally needed.

If the search returns nothing, check that you are online and that Windows Update is not blocked by a policy or a metered connection. To undo the install later, go back to the same Optional features page, select the feature and click Uninstall.

Windows 11 Start menu showing Settings option
windows 11 start settings
Windows 11 Apps section in Optional Features
widnows 11 apps optional features
Windows 11 interface for adding Optional Features
windows 11 add optional features
OpenSSH Server installation process in Windows 11
openssh server windows 11 install
Completion screen for OpenSSH Server installation
openssh server windows 11 complete install

Method 2Using PowerShell (Fastest Way)

If you prefer the command line, you can install the OpenSSH server from PowerShell instead of using steps 1 to 8. Open PowerShell as an administrator first, because the command fails without elevated rights. Right-clicking the Start button and choosing the Terminal (Admin) entry is the quickest way. Accept the User Account Control prompt if it appears. Then enter `Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0`.

This command adds the OpenSSH server to your Windows 11 system, which makes remote access possible. It downloads the feature just as Settings does, so it also needs an internet connection. It can take a minute or two. When it finishes, PowerShell reports whether a restart is needed. Normally it is not. Once it completes, continue with step 9 below.

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

Starting and Managing the Service

Starting the OpenSSH Server Windows 11 service lets other devices connect to your computer over the network. The service is called OpenSSH SSH Server in the Services app. Its short name is sshd. Starting it once and setting it to run automatically means it comes back after every reboot.

  1. Press Win+R. The Run dialog opens.
  2. Type `services.msc` and press Enter. The Services window opens with an alphabetical list.
  3. Find OpenSSH SSH Server in the list. It is in the O section, so scroll down a little.
  4. Right-click it and choose Start. The Status column should now read Running.
  5. Right-click OpenSSH SSH Server again and select Properties. The properties window opens on the General tab.
  6. Set Startup type to Automatic. Use the drop-down menu in the same window.
  7. Click Apply. The setting is saved but the window stays open.
  8. Click OK. The window closes and the service now starts with Windows.

If the service is missing from the list, the installation did not complete. Go back to the install steps and check that the feature shows as installed. If you ever want to stop remote access, right-click the service and choose Stop. Then open Properties and set the startup type to Manual or Disabled.

Windows 11 Services search results for OpenSSH
windows 11 services search results
Starting OpenSSH SSH Server in Windows 11
windows 11 openssh ssh server start

To confirm the service is running, run `Get-Service sshd` in PowerShell. The Status column should show Running. If it shows Stopped, go back to the Services app and start the service again. A regular PowerShell window is enough for this check.

Configuration and Security

📝Good to KnowThe main configuration file, `sshd_config`, is usually found at `📁C:\ProgramData\ssh\sshd_config`.

You can edit it to change the default port or restrict which accounts may log in. Open it in a text editor that was started as administrator, or Windows will not let you save your changes.

Advertisement
💡TipThe service reads this file only when it starts.

After any edit, restart the OpenSSH SSH Server service from the Services app so the change takes effect. Make a copy of the file before you edit it, so you can put the original back if the service refuses to start.

Setting up Key-Based Authentication

Passwords can be guessed, and an SSH server on the network will attract guessing attempts. An SSH key pair is much safer. You generate a public and a private key on the device you connect from. Then you place the public key in `📁C:\Users\YourUsername\.ssh\authorized_keys` on the Windows 11 PC, replacing YourUsername with the real account name. The private key never leaves your own device. This also lets you log in without typing a password each time.

Accounts in the Administrators group are handled differently. By default, the server looks for their keys in a separate file named in `sshd_config`, not in the user’s own .ssh folder. If key login fails for an admin account, check that file first. Once keys work, you can turn off password logins in the configuration file. Test a key login first so you don’t lock yourself out. Keep a second session open while you test, so you can fix the file if something goes wrong.

Troubleshooting

If you cannot connect, check Windows Firewall. The installation usually creates an inbound rule, but confirm that port 22 (or your custom port, if you changed it) is open. Use the command netsh advfirewall firewall show rule name=all to verify.

Advertisement

If you changed the port in `sshd_config`, the firewall rule must match it. Also confirm that the network profile is not blocking the rule, and that the PC's IP address is the one you are connecting to. If the service shows Running but connections time out, the firewall is the most common cause.

Summary

Setting up OpenSSH Server on Windows 11 gives you a secure way to control your PC remotely. Install it through Settings or PowerShell, start the service and set it to run automatically, then check your firewall. For better security, use key-based logins instead of passwords.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Tags: #Windows 11

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

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 *