OpenSSH, a popular open-source implementation of SSH (Secure Shell) protocol is now available as an optional feature in Windows 11. With just a few clicks, you can install an SSH server on Windows 11. Once installed, the SSH server allows you to connect to your Windows 11 machine using any SSH client.
So, without further ado, let me guide you through the steps to install OpenSSH server on Windows 11.
Install OpenSSH server on Windows 11
To install OpenSSH server on Windows 11, follow the steps outlined below:
- Open Settings.
- Navigate to Apps on the sidebar.
- Click/tap on Optional Features.
- Press the View features button.
- Select the OpenSSH Server checkbox.
- Press the Next button.
- With that, you are done installing OpenSSH server on Windows 11.
Let’s see the steps in more detail:
As you’d normally do, open the “Settings” app in Windows 11 using the Windows key + I keyboard shortcut. You can also right-click on the start icon on the taskbar and choose the Settings option. Once the Settings app opens, go to the “Apps” category on the sidebar. This is where you will find all the options to manage apps and other related settings.
On the Apps page, click/tap on the “Optional Features” option.
Now, click/press the “View features” button in the “Add an optional feature” section.
This will open the Add an optional feature window. Use the search bar at the top to search for “OpenSSH Server.” You can also scroll the list to find it. Once found, select the OpenSSH Server checkbox and click/press the “Next” button.
As soon as you do that, Windows 11 downloads the optional OpenSSH Server module and installs it automatically.
Once installed, you can close the Settings window by clicking on the X icon.
Configure OpenSSH server on Windows 11
After installing the SSH server on Windows 11, you need to make sure the SSH server service runs automatically and it is using port 22. Here’s how.
First of all, right-click on the start icon on the taskbar and select the Windows Terminal (Admin) option. This will open Windows Terminal with the PowerShell tab as an administrator.
Next, type the below commands one after another. These commands will start the sshd and ssh-agent services and set them to start automatically.
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
Start-Service ssh-agent
Set-Service -Name ssh-agent -StartupType 'Automatic'
Note: If you don’t want to use the command line, you can find and configure both services in the Microsoft Services (services.msc) window.
Next, run the below command to check if SSH is using port 22.
netstat -nao | find /i '":22"'
If you want to further configure your SSH server, you can do so using the SSH config file. You can find the SSH config file in Windows 11 at the “%programdata%\ssh\sshd_config” location (C:\ProgramData\ssh\sshd_config).
That is it. It is that simple to install and enable SSH server on Windows 11 using OpenSSH Server.
I hope this simple and easy Windows how-to guide helped you.
If you are stuck or need help, send an email, and I will try to help as much as possible.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\bigfe> start-service sshd
start-service : Cannot find any service with service name ‘sshd’.
At line:1 char:1
+ start-service sshd
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (sshd:String) [Start-Service
], ServiceCommandException
+ FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerSh
ell.Commands.StartServiceCommand
PS C:\Users\bigfe> set-service -Name sshd -StartupType ‘Automatic’
set-service : Service sshd was not found on computer ‘.’.
At line:1 char:1
+ set-service -Name sshd -StartupType ‘Automatic’
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.:String) [Set-Service], In
validOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShe
ll.Commands.SetServiceCommand
PS C:\Users\bigfe> Start-service sshd
Start-service : Cannot find any service with service name ‘sshd’.
At line:1 char:1
+ Start-service sshd
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (sshd:String) [Start-Service
], ServiceCommandException
+ FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerSh
ell.Commands.StartServiceCommand
PS C:\Users\bigfe> Start-Service sshd
Start-Service : Cannot find any service with service name ‘sshd’.
At line:1 char:1
+ Start-Service sshd
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (sshd:String) [Start-Service
], ServiceCommandException
+ FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerSh
ell.Commands.StartServiceCommand
PS C:\Users\bigfe> Set-Service -Name sshd -StartupType ‘Automatic’
Set-Service : Service sshd was not found on computer ‘.’.
At line:1 char:1
+ Set-Service -Name sshd -StartupType ‘Automatic’
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.:String) [Set-Service], In
validOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShe
ll.Commands.SetServiceCommand
PS C:\Users\bigfe> Start-Service ssh-agent
Start-Service : Service ‘OpenSSH Authentication Agent (ssh-agent)’ cannot
be started due to the following error: Cannot start service ssh-agent on
computer ‘.’.
At line:1 char:1
+ Start-Service ssh-agent
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceCon
troller:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Co
mmands.StartServiceCommand
PS C:\Users\bigfe> Set-Service -Name ssh-agent -StartupType ‘Automatic’
PS C:\Users\bigfe> netstat -nao | /i ‘”:22″‘
/i : The term ‘/i’ is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:16
+ netstat -nao | /i ‘”:22″‘
+ ~~
+ CategoryInfo : ObjectNotFound: (/i:String) [], CommandNotFo
undException
+ FullyQualifiedErrorId : CommandNotFoundException
Hi
//I have a window 11 client machine and I tried but got the above exceptions. didn’t work for me. Can you help, please?
The error message you are encountering indicates that the SSH server service (sshd) is not installed on your Windows machine. Make sure you install the SSH server first and then try again. To verify if the SSH server is installed, run the following command in PowerShell as an admin:
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'