How to install OpenSSH in Windows 10

Categories:

Problem

Install OpenSSH in Windows 10.

Solution

  1. Run PowerShell as Administrator.

  2. Check OpenSSH packages:

    1Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

    Output:

    Name  : OpenSSH.Client~~~~0.0.1.0
    State : NotPresent
    
    Name  : OpenSSH.Server~~~~0.0.1.0
    State : NotPresent
  3. Install OpenSSH:

    1# Install the OpenSSH Client
    2Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
    3
    4# Install the OpenSSH Server
    5Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
  4. Set up SSH agent in WSL2 if needed.

See Also