I'm an enthusiastic fan of Digital Ocean (DO from here on) and their Droplets which, to quote directly from the DO website:
flexible Linux-based virtual machines (VMs) that run on top of virtualized hardware
You can spin up a Droplet in around a minute running any of a massive array of open source applications from their Marketplace. I took advantage of this a while ago to migrate this here blog, I use ghost as my blogging tool of choice, to a droplet running on their $5 a month plan and life was good.
Today life is still good but it's been a while since I spun up my Droplet so I would like to update my ghost instance and the Linux VM it's running on. Fortunately for me another nice DO feature is their web console which means I can log in to my DO account click on the
console link for my Droplet and it will open a web console in a new browser window:
The web console gives me an SSH connection straight into my VM so I can easily manage it just like I would any other Linux instance. Now in a perfect world I would be able to run whatever commands I like from the web console but unfortunately it has a rather painful bug - it's not possible to type symbols on the console 😱. You can work around this by using the Alt key to type symbol codes it's not exactly the most elegant of processes.
Time to connect via SSH and do things properly but today I'm using a Windows laptop. In the past I would have used WSL or installed PuTTY but now we're all living the future, finally, Windows ships with OpenSSH available out of the box so here's a quick guide on how to enable that.
You'll need version 1709 or later of Windows 10 but that was released in January 2018 so unless you really hate Windows Update you'll be well ahead of that. To check if OpenSSH is installed you can run the following command in PowerShell with Administrator permissions:
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
You'll get a response similar to:
Name : OpenSSH.Client~~~~0.0.1.0
State : NotPresent
Name : OpenSSH.Server~~~~0.0.1.0
State : NotPresent
For now, we're not interested in the OpenSSH.Server so let's focus instead on the OpenSSH.Client State. If instead of NotPresent you see Installed then yay 🙌 you already have an SSH client. If you do see NotPresent we can fix that quickly by running:
# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
And you should see the following output:
Online : True
RestartNeeded : False
So now I have OpenSSH available and can connect directly to Droplet just like I would if I were on Linux or Mac.