-
Notifications
You must be signed in to change notification settings - Fork 767
Building OpenSSH for Windows (using LibreSSL crypto)
- git clone https://github.com/PowerShell/openssh-portable
- git checkout latestw_all
-
Download and Install Visual Studio - latest install here.
-
If using the Visual Studio installer, select the following:
- Desktop Development with C++ Workload
- Windows 11 SDK 10.0.22621.0 Individual Component
- MSVC 143 Build Tool(s) Individual Component(s) - up to 3 depending on which architecture(s) will be built: x86/x64, ARM, ARM64
- MSVC 143 Spectre-Mitigated Lib(s) Individual Component(s) - up to 3 depending on which architecture(s) will be built: x86/x64, ARM, ARM64
-
Confirm the selections look something like this:
-
Confirm the Desktop Development with C++ Kit was installed properly by checking
${env:ProgramFiles}\Microsoft Visual Studio\*\*\VC\Auxiliary\Build
for avcvarsall.bat
file, as shown in the image below:
-
-
Install Windows SDK 10.0.22621.0 during Visual Studio install, or download from here
- Confirm the SDK was installed properly by checking
${env:ProgramFiles(x86)}\Windows Kits\10\Bin
for a10.0.22621.0
folder, as shown in the image below:
- Confirm the SDK was installed properly by checking
-
Confirm the Build Tools were installed properly by checking
${env:ProgramFiles}\Microsoft Visual Studio\2022\*\MSBuild\Microsoft\VC\v170
for aMicrosoft.Cpp.Default.Props
file, as shown in the image below: -
Open
contrib\win32\openssh\Win32-OpenSSH.sln
in Visual Studio, if prompted ensure platform toolset is set to "no upgrade" and Windows SDK is set to "10.0.22621.0" -
If necessary, change the configuration and architecture from the middle toolbar
-
Build the Win32-OpenSSH binaries
-
Note: after the first build of a configuration & architecture or if a new libcrypto version is being pulled in, the corresponding
libcrypto.dll
needs to be copied from\contrib\win32\openssh\libressl\bin\desktop\{Architecture}\
to.\bin\{Architecture}\{Configuration}
- Binaries will be in a
\bin\{Architecture}\{Configuration}
folder, as shown in the image below for an x64, Debug build:
- Binaries will be in a
In Powershell:
- cd repository-root
- ipmo .\contrib\win32\openssh\OpenSSHBuildHelper.psm1 -Force
- Start-OpenSSHBuild -Configuration <Release|Debug> -NativeHostArch <x64|x86|ARM|ARM64>
- Start-OpenSSHPackage -Configuration <Release|Debug> -NativeHostArch <x64|x86|ARM|ARM64>
- Above generates Zipped binary and symbols payload. Follow further installation instructions here.
- MSI Install Instructions
- Script Install Instructions
- Alternative installation using the universal installer
- Retrieving download links for the latest packages