OpenSSH on Windows Server 2019
The OpenSSH client and server are now available as a supported Feature-on-Demand in Windows Server 2019 and Windows 10 1809! The Win32 port of OpenSSH was first included in the Windows 10 Fall Creators Update and Windows Server 1709 as a pre-release feature. In the Windows 10 1803 release, OpenSSH was released as a supported feature on-demand component, but there was not a supported release on Windows Server until now.
What is OpenSSH?
OpenSSH is a collection of client/server utilities that enable secure remote login, remote file transfer, and public/private key pair management. OpenSSH is a powerful tool that originated as part of the OpenBSD project and has been used for many years across the BSD, Linux, macOS, and Unix ecosystems. Adding OpenSSH to Windows Server 2019 allows organizations that work across a broad range of operating systems to use a consistent set of tools for remote server administration.
Short for Open Secure Shell, OpenSSH is a free suite of tools (similar to the SSH connectivity tools) that help secure your network connections. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking and other network-level attacks.
The OpenSSH suite includes the ssh program that replaces rlogin and telnet, and scp which replaces rcp and ftp. OpenSSH has also added sftp and sftp-server which implement an easier solution for file-transfer. OpenSSH comes in two downloadable distributions: the native OpenBSD distribution and the multi-platform portable distribution. OpenSSH is developed by the OpenBSD Project.
Installation of OpenSSH For Windows Server 2019 and Windows 10
To install OpenSSH, start Settings then go to Apps > Apps and Features > Manage Optional Features.
Scan this list to see if OpenSSH client is already installed. If not, then at the top of the page select “Add a feature”, then:
- To install the OpenSSH client, locate “OpenSSH Client”, then click “Install”.
- To install the OpenSSH server, locate “OpenSSH Server”, then click “Install”.
Once the installation completes, return to Apps > Apps and Features > Manage Optional Features and you should see the OpenSSH component(s) listed.
Installing OpenSSH with PowerShell
To install OpenSSH using PowerShell, first launch PowerShell as an Administrator. To make sure that the OpenSSH features are available for install:PowerShellCopy
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*' # This should return the following output: Name : OpenSSH.Client~~~~0.0.1.0 State : NotPresent Name : OpenSSH.Server~~~~0.0.1.0 State : NotPresent
Then, install the server and/or client features:PowerShellCopy
# Install the OpenSSH Client Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 # Install the OpenSSH Server Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 # Both of these should return the following output: Path : Online : True RestartNeeded : False
To uninstall OpenSSH using the Windows Settings, start Settings then go to Apps > Apps and Features > Manage Optional Features. In the list of installed features, select the OpenSSH Client or OpenSSH Server component, then select Uninstall.
To uninstall OpenSSH using PowerShell, use one of the following commands:PowerShellCopy
# Uninstall the OpenSSH Client Remove-WindowsCapability -Name OpenSSH.Client~~~~0.0.1.0 # Uninstall the OpenSSH Server Remove-WindowsCapability -Name OpenSSH.Server~~~~0.0.1.0
A Windows restart may be required after removing OpenSSH, if the service is in use at the time it was uninstalled.
The Future Of Remoting In Windows
With OpenSSH, you can remote into any operating system from any operating system. This is a wonderful thing!
Linux and Windows professionals are usually a little bit at odds with the others platform. Most IT professionals prefer one platform over the other, which is not a bad thing, just a fact. Linux professionals scoff at having to login to Windows computers, and Windows professionals frequently have to search Google on how to exit vim in Linux.
In recent years, Microsoft has made countless, purposeful decisions to better integration Windows with Linux. Windows 10 now has a Linux Subsystem that can be installed within Windows allowing users to run Linux on Windows, Azure has a massive amount of their workloads running Linux, PowerShell is now opensource and available on Linux.
Another example of Microsoft’s effort is the project of delivering OpenSSH on Windows. OpenSSH of course is the most popular method of running remote code on a Linux machine, and has been around for many years. Now that it is close to being production-ready in Windows, this means it can be used on practically any platform.
If you manage both Windows and Linux in your environment (which almost everyone does) why would you want to use more than one method to remotely manage computers? The correct answer is, you shouldn’t. Most PowerShell users currently use WS-Management for remoting into their Windows machines, but this is a protocol used primarily in Windows. With SSH, you can remote into any operating system from any operating system. This is a wonderful thing!
Why it Makes Life Easier for IT Pros
Being that my expertise is in Windows, when I want to remote into a Linux server, I normally use something like Putty. Putty is a Windows utility that allows you to SSH into Linux. Don’t get me wrong, Putty works great, but it means having a separate application for using Linux from Windows and it not native to the OS. Not fun. I spend the majority of my time in a PowerShell prompt, I don’t want to use a different application.
With OpenSSH on Windows, I can actually SSH right into a Linux machine (or Windows) right from PowerShell (or CMD). This means I just need one command prompt to do all my work on whatever platform I need to work on. This makes my job simpler. Simple is good. Simple in IT is ALWAYS better.
Even more, using OpenSSH on Windows allows you to perform PowerShell Core remoting commands like Enter-PSSessioninto Linux, for those who want to continue using PowerShell remoting commands.
Looking for ASP.NET Core hosting?
While choosing a new web host, make sure you don’t make the same common mistakes that most beginners do. A few of my favorite web hosts are ASPHostPortal, HostForLIFE, UKWindowsHostASP.NET. I recently reviewed ASPHostPortal and in my opinion, they’re the best-shared host out there out of the large lot of hosts I’ve tested. If you’re curious as to why I never had to switch to another host since 2014, give my ASPHostPortal review a read.
A great place to look for a new web host is WebHostingTalk. Their members are very helpful and new members get proper guidance on choosing a web host.