SSH Server on Windows 10
Tom Fenton, delighted to discover that Microsoft now includes an SSH server with Windows 10 that unfortunately is not enabled or configured by default, shows you how to do so.
In a previous article, I showed you how to use Secure Shell (SSH) and Secure Copy (SCP). SSH is used to securely connect to remote systems, and SCP is used to securely copy files from one system to another. These commands rely on having an SSH server on the system that you are connecting to, and I was delighted to see that Microsoft now includes an SSH server with Windows 10. However, this SSH server is not enabled or configured by default, so in this article I will show you how to do so.
You can install OpenSSH Server by launching Windows Settings and then navigating to Apps > Optional features, clicking Add a feature, selecting OpenSSH Server, and clicking Install.
Once added, it will be shown in the list of optional features.
Once it is installed, you will need to start the service. I used PowerShell to do this, but there are other ways you can do so using the GUI or command line.
I launched PowerShell as Administrator, and entered the following commands to see the status of the service, start the service, and then verify that the service was running:
Get-Service sshd ← sshd is the OpenSSH service
Start-Service sshd ← Starts the sshd service
Get-Service sshd ← Verifies that the sshd service is running
As I wanted the SSH service to start every time the system booted up, I entered:
Set-Service -Name sshd -StartupType 'Automatic'
To check and make sure that the port for the SSH server was open, I entered:
Get-NetFirewallRule -Name *ssh*
If you have any other firewall or security tools running, you will also need to configure them to allow for SSH connections.
I then checked that my SSH server was operational by connecting to the Windows system that I was currently on by going back to the command console and entering:
ssh [email protected]
To check that the firewalls for my SSH server was correctly configured by going to another Windows 10 machine and verify that I was able to SSH to this system by entering:
ssh [email protected]
Finally, I verified that I was able to copy a file from a remote system to my local system by entering:
scp [email protected]:/TestFile CopyOfFile
In a previous article, I showed you how to use SSH on Windows 10 to securely connect to a remote machine, and how to securely copy files using SCP to a Windows 10. In this article I showed you how to install OpenSSH Server on a Windows 10 system so it can accept SSH connections. Both SSH and SCP are invaluable tools when working with or administrating multiple machines, and I am glad to see that Microsoft now includes them with Windows 10.
Tom Fenton has a wealth of hands-on IT experience gained over the past 25 years in a variety of technologies, with the past 15 years focusing on virtualization and storage. He currently works as a Technical Marketing Manager for ControlUp. He previously worked at VMware as a Senior Course Developer, Solutions Engineer, and in the Competitive Marketing group. He has also worked as a Senior Validation Engineer with The Taneja Group, where he headed the Validation Service Lab and was instrumental in starting up its vSphere Virtual Volumes practice. He's on Twitter @vDoppler.