Prerequisites
Before we begin, you need to make sure that you have PowerShell 5.1 or later installed on your computer. You also need to have an account that is a member of the built-in Administrators group. To validate your environment, open an elevated PowerShell session and do the following:
- Type
winver.exe
and press enter to see the version details for your Windows device. - Run
$PSVersionTable.PSVersion
. - Run the command below. The output will show True when you’re a member of the built-in Administrators group.
(New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent ())).IsInRole ([Security.Principal.WindowsBuiltInRole]::Administrator)
Steps to Install OpenSSH
- Open Windows PowerShell by typing “PowerShell” in the search bar and selecting “Windows PowerShell” from the results.
- Type the following command to install the OpenSSH components:
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
- Once setup completes, return to Apps and Optional Features and confirm OpenSSH is listed.
- Open the Services desktop app. (Select Start, type services.msc in the search box, and then select the Service app or press ENTER .)
- In the details pane, double-click OpenSSH SSH Server.
- On the General tab, from the Startup type drop-down menu, select Automatic.
- To start the service, select Start.
That’s it! You have successfully installed OpenSSH on your Windows computer. Now you can use Windows PowerShell and OpenSSH to generate a private/public key pair.