Install OpenSSH client in Windows without internet access

Solution 1:

If you are willing to accept a sort of manual and hacky way, it is possible to download their official releases, extract the binaries and add them to your PATH environment variable.

Solution 2:

The Add-WindowsCapability cmdlet does have a method for installing from a local package file. I've copied the example from the link here. The key is the -Source parameter which should point to the location of the CAB file containing the windows feature to be installed.

Add-WindowsCapability -Online -Name "Msix.PackagingTool.Driver~~~~0.0.1.0" -Source "E:\" -LimitAccess

In order to obtain a CAB file you will need to first get the Windows FOD (Feature-On-Demand) ISO and extract the necessary package from within.

P.S. The -Online flag is used when installing into a live OS, and does not refer to an active internet connection.

Solution 3:

From: Secure Infrastructure Blog by the Secure Infrastructure team at Microsoft

Offline installation of OpenSSH Server on Windows Server 2019

For this work around you will need both the Windows Server 2019 Features On Demand disc and the Windows 10 Features On Demand disc. Once you have both discs / ISOs downloaded follow these simple steps.

Extract the entire Windows Server 2019 Features On Demand ISO to a local directory on the server (e.g. C:\FOD). Open up the Windows 10 Features On Demand ISO and copy the following cab files to the directory with the extracted Windows Server 2019 Features On Demand files. OpenSSH-Client-Package~31bf3856ad364e35~amd64~~.cab OpenSSH-Server-Package~31bf3856ad364e35~amd64~~.cab Run the Add-WindowsCapability -online -name OpenSSH.Server~~~~0.0.1.0 -source C:\FOD You will then see the following output:

Add-WindowsCapability -Name OpenSSH.Server~~~~0.0.1.0 -Online -Source c:\FOD

Path :
Online : True
RestartNeeded : False

Now OpenSSH Server is installed on the server in an offline environment you will be able to see the OpenSSH SSH Server service.