How to install OpenSSH server on Windows Server 2022 in offline environment

This post shows how to install OpenSSH server on Windows Server 2022 that is in an offline (blocked internet access) environment.

If Windows Server 2019, refer to the following post.
>> How to install OpenSSH server on Windows Server 2019 in offline environment


OpenSSH has been added to Windows Server and supported since Windows Server 2019 or later. Microsoft shows the installation guide on the following website.
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse
But to follow this guide, internet access is required.

If you can not access internet, it shows the following error on See optional feature history
Error code: 0x8024402C

1. Download LOF ISO of Windows Server 2022

To download Language and Optional Features (LOF) ISO, open the following website of Windows Server 2022 and click the link of ISO in Overview on an online (internet-accessible) environment.
https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2022

2. Copy OpenSSH server package from LOF media

Copy OpenSSH-Server-Package~31bf3856ad364e35~amd64~~.cab from LOF ISO to the server to be installed OpenSSH server.

3. Install OpenSSH server

To install OpenSSH server, run the following cmdlet on a PowerShell as administrator.
Note: Assume that the cab file is on C:\temp .

Add-WindowsCapability -online -name OpenSSH.Server~~~~0.0.1.0 -source C:\temp

If it shows like the following, installed successfully.

Path         : 
Online       : True
ResartNeeded : False

That’s about it.