Install OpenSSH via PowershellΒΆ

When you use ssh <username>@<hostname>.local (or ssh <username>@<IP address>) to connect to your Raspberry Pi, but the following error message appears.

ssh: The term 'ssh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.

It means your computer system is too old and does not have OpenSSH pre-installed, you need to follow the tutorial below to install it manually.

  1. Type powershell in the search box of your Windows desktop, right click on the Windows PowerShell, and select Run as administrator from the menu that appears.

  2. Use the following command to install OpenSSH.Client.

    Add-WindowsCapability -Online -Name OpenSSH.Client~~~~
  3. After installation, the following output will be returned.

    Path          :
    Online        : True
    RestartNeeded : False
  4. Verify the installation by using the following command.

    Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
  5. It now tells you that OpenSSH.Client has been successfully installed.

    Name  : OpenSSH.Client~~~~
    State : Installed
    Name  : OpenSSH.Server~~~~
    State : NotPresent


    If the above prompt does not appear, it means that your Windows system is still too old, and you are advised to install a third-party SSH tool, like PuTTY.

  6. Now restart PowerShell and continue to run it as administrator. At this point you will be able to log in to your Raspberry Pi using the ssh command, where you will be prompted to enter the password you set up earlier.