Solarian Programmer

My programming ramblings

Enable OpenSSH server on Windows 10

Posted on October 27, 2020 by Paul

In this article, I will show you how to enable the OpenSSH server on Windows 10 and how to connect through ssh to a Windows 10 machine.

By default, recent versions of Windows 10 have an OpenSSH client already installed, this means that you can use a Windows 10 machine to connect through ssh to other machines, typically Linux servers, that have an ssh server enabled. How about when you want to be able to connect through ssh to another Windows computer ?

Go to the Windows Start menu and select Settings, next go to AppsOptional featuresAdd a feature, on this page, search for OpenSSH Server or scroll until you find it and check the left box. Press Install.

Once the installation has finished, you need to start the OpenSSH server in order to be able to connect to this machine. Open a PowerShell window as an Administrator: go to StartWindows Power Shell and right click on the Windows Power Shell app select More and pick Run as administrator, answer Yes when asked if you want to let this app to make changes to your device.

At this point, you can temporarily enable the OpenSSH server by writing the next command in Windows Power Shell:

1 Start-Service -Name "sshd"

You can connect to your Windows machine with:

1 ssh user_name@your_ip_address

If you need to find your IP address, run this command in PowerShell:

1 Get-NetIPAddress

When you will stop or restart Windows, the OpenSSH server will be also stopped. If you need to reenable it, you can use the above command to start the service or, if you know that you want this to be on permanently, write the next two commands in a PowerShell administrator window:

1 Start-Service -Name "sshd"
2 Set-Service -Name "sshd" -StartupType Automatic

The above will ensure that after a restart the sshd service will be always on.

Show Comments