Skip to content

v9.4.0.0p1-Beta installation hangs #2161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
user8446 opened this issue Oct 10, 2023 · 24 comments
Closed

v9.4.0.0p1-Beta installation hangs #2161

user8446 opened this issue Oct 10, 2023 · 24 comments

Comments

@user8446
Copy link

user8446 commented Oct 10, 2023

Hi,

Just reporting that the v9.4.0.0p1-Beta that was just released hangs on installation.

The issue is sshd.exe which fails to start.

Rolling back to v9.2.2.0p1-Beta or if I roll back just sshd.exe to v9.2.0 works as expected and sshd.exe starts.

Version

v9.4.0.0p1-Beta

@Murazaki
Copy link

Same situation, happens through install on Winget too.
Fixing permissions does not solve this.

Windows 11 Pro 10.0.22621

@Murazaki
Copy link

Murazaki commented Oct 11, 2023

I tried running manually the PowerShell script here (https://github.com/PowerShell/openssh-portable/blob/latestw_all/contrib/win32/openssh/install-sshd.ps1) and it fixed the situation somehow, even though I still have an error at the end of the install process.

Installer failed with exit code: 1603
Installer log is available at: C:\Users\<redacted>\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.OpenSSH.Beta.9.4.0.0-2023-10-11-09-42-54.478.log

Here is the install log from Winget

=== Logging started: 11/10/2023  10:09:55 ===
Action 10:09:55: INSTALL. 
Action start 10:09:55: INSTALL.
Action 10:09:55: FindRelatedProducts. Searching for related applications Found application: [1]
Action start 10:09:55: FindRelatedProducts.
FindRelatedProducts: 
Action ended 10:09:55: FindRelatedProducts. Return value 1.
Action 10:09:55: LaunchConditions. Evaluating launch conditions
Action start 10:09:55: LaunchConditions.
Action ended 10:09:55: LaunchConditions. Return value 1.
Action 10:09:55: ValidateProductID. 
Action start 10:09:55: ValidateProductID.
Action ended 10:09:55: ValidateProductID. Return value 1.
Action 10:09:55: CostInitialize. Computing space requirements
Action start 10:09:55: CostInitialize.
Action ended 10:09:56: CostInitialize. Return value 1.
Action 10:09:56: FileCost. Computing space requirements
Action start 10:09:56: FileCost.
Action ended 10:09:56: FileCost. Return value 1.
Action 10:09:56: CostFinalize. Computing space requirements
Action start 10:09:56: CostFinalize.
Action ended 10:09:56: CostFinalize. Return value 1.
Action 10:09:56: MigrateFeatureStates. Migrating feature states from related applications Application: [1]
Action start 10:09:56: MigrateFeatureStates.
Action ended 10:09:56: MigrateFeatureStates. Return value 1.
Action 10:09:56: ExecuteAction. 
Action start 10:09:56: ExecuteAction.
Action start 10:10:04: INSTALL.
Action start 10:10:04: FindRelatedProducts.
Action ended 10:10:04: FindRelatedProducts. Return value 0.
Action start 10:10:04: LaunchConditions.
Action ended 10:10:04: LaunchConditions. Return value 1.
Action start 10:10:04: ValidateProductID.
Action ended 10:10:04: ValidateProductID. Return value 1.
Action start 10:10:04: CostInitialize.
Action ended 10:10:04: CostInitialize. Return value 1.
Action start 10:10:04: FileCost.
Action ended 10:10:04: FileCost. Return value 1.
Action start 10:10:04: CostFinalize.
Action ended 10:10:04: CostFinalize. Return value 1.
Action start 10:10:04: MigrateFeatureStates.
Action ended 10:10:04: MigrateFeatureStates. Return value 0.
Action start 10:10:04: InstallValidate.
Action ended 10:12:01: InstallValidate. Return value 1.
Action start 10:12:01: InstallInitialize.
Action ended 10:12:01: InstallInitialize. Return value 1.
Action start 10:12:01: RemoveExistingProducts.
Action start 10:12:01: INSTALL.
Action start 10:12:01: FindRelatedProducts.
Action ended 10:12:01: FindRelatedProducts. Return value 0.
Action start 10:12:01: LaunchConditions.
Action ended 10:12:01: LaunchConditions. Return value 1.
Action start 10:12:01: ValidateProductID.
Action ended 10:12:01: ValidateProductID. Return value 1.
Action start 10:12:01: CostInitialize.
Action ended 10:12:02: CostInitialize. Return value 1.
Action start 10:12:02: FileCost.
Action ended 10:12:02: FileCost. Return value 1.
Action start 10:12:02: CostFinalize.
Action ended 10:12:02: CostFinalize. Return value 1.
Action start 10:12:02: MigrateFeatureStates.
Action ended 10:12:02: MigrateFeatureStates. Return value 0.
Action start 10:12:02: InstallValidate.
Action ended 10:12:02: InstallValidate. Return value 1.
Action start 10:12:02: InstallInitialize.
Action ended 10:12:02: InstallInitialize. Return value 1.
Action start 10:12:02: RemoveExistingProducts.
Action ended 10:12:02: RemoveExistingProducts. Return value 0.
Action start 10:12:02: ProcessComponents.
Action ended 10:12:02: ProcessComponents. Return value 1.
Action start 10:12:02: UnpublishFeatures.
Action ended 10:12:02: UnpublishFeatures. Return value 1.
Action start 10:12:02: StopServices.
Action ended 10:12:02: StopServices. Return value 1.
Action start 10:12:02: DeleteServices.
Action ended 10:12:02: DeleteServices. Return value 1.
Action start 10:12:02: RemoveRegistryValues.
Action ended 10:12:02: RemoveRegistryValues. Return value 1.
Action start 10:12:02: ConfigureEventManifestUnregister.
Action start 10:12:02: RollbackUnregisterEventManifest.
Action ended 10:12:02: RollbackUnregisterEventManifest. Return value 1.
Action start 10:12:02: UnregisterEventManifest.
Action ended 10:12:02: UnregisterEventManifest. Return value 1.
Action ended 10:12:02: ConfigureEventManifestUnregister. Return value 1.
Action start 10:12:02: RemoveEnvironmentStrings.
Action ended 10:12:02: RemoveEnvironmentStrings. Return value 1.
Action start 10:12:02: WixSchedFirewallExceptionsUninstall.
SchedFirewallExceptions:  Scheduling firewall exception (2�OpenSSH SSH Server Preview (sshd)�2�*�0�2�C:\Program Files\OpenSSH\sshd.exe�22�6�Inbound rule for OpenSSH SSH Server (sshd))
Action start 10:12:02: WixRollbackFirewallExceptionsUninstall.
Action ended 10:12:02: WixRollbackFirewallExceptionsUninstall. Return value 1.
Action start 10:12:02: WixExecFirewallExceptionsUninstall.
Action ended 10:12:02: WixExecFirewallExceptionsUninstall. Return value 1.
Action ended 10:12:02: WixSchedFirewallExceptionsUninstall. Return value 1.
Action start 10:12:02: RemoveFiles.
Action ended 10:12:02: RemoveFiles. Return value 0.
Action start 10:12:02: InstallFiles.
Action ended 10:12:02: InstallFiles. Return value 1.
Action start 10:12:02: WixSchedFirewallExceptionsInstall.
SchedFirewallExceptions:  Component 'sshd.exe' action state (2) doesn't match request (1)
SchedFirewallExceptions:  No firewall exceptions scheduled
Action ended 10:12:02: WixSchedFirewallExceptionsInstall. Return value 1.
Action start 10:12:02: DuplicateFiles.
Action ended 10:12:02: DuplicateFiles. Return value 1.
Action start 10:12:02: SchedXmlFile.
Action ended 10:12:02: SchedXmlFile. Return value 1.
Action start 10:12:02: ConfigureEventManifestRegister.
Action ended 10:12:02: ConfigureEventManifestRegister. Return value 1.
Action start 10:12:02: WriteRegistryValues.
Action ended 10:12:02: WriteRegistryValues. Return value 1.
Action start 10:12:02: WriteEnvironmentStrings.
Action ended 10:12:02: WriteEnvironmentStrings. Return value 1.
Action start 10:12:02: InstallServices.
Action ended 10:12:02: InstallServices. Return value 1.
Action start 10:12:02: SetSetPrivilegesOnSshAgent.
Action ended 10:12:02: SetSetPrivilegesOnSshAgent. Return value 1.
Action start 10:12:02: SetSetPrivilegesOnSshd.
Action ended 10:12:02: SetSetPrivilegesOnSshd. Return value 1.
Action start 10:12:02: StartServices.
Action ended 10:12:02: StartServices. Return value 1.
Action start 10:12:02: RegisterUser.
Action ended 10:12:02: RegisterUser. Return value 0.
Action start 10:12:02: RegisterProduct.
Action ended 10:12:02: RegisterProduct. Return value 1.
Action start 10:12:02: PublishFeatures.
Action ended 10:12:02: PublishFeatures. Return value 1.
Action start 10:12:02: PublishProduct.
Action ended 10:12:02: PublishProduct. Return value 1.
Action start 10:12:02: InstallFinalize.
ExecFirewallExceptions:  Uninstalling firewall exception2 OpenSSH SSH Server Preview (sshd) (C:\Program Files\OpenSSH\sshd.exe)
Action ended 10:12:04: InstallFinalize. Return value 1.
Action ended 10:12:04: INSTALL. Return value 1.
Property(N): UpgradeCode = {9E9D0D93-E70D-4424-ADBD-AD3B226A226D}
Property(N): WixRollbackFirewallExceptionsUninstall = 2�OpenSSH SSH Server Preview (sshd)�2�*�0�2�C:\Program Files\OpenSSH\sshd.exe�22�6�Inbound rule for OpenSSH SSH Server (sshd)
Property(N): WixExecFirewallExceptionsUninstall = 2�OpenSSH SSH Server Preview (sshd)�2�*�0�2�C:\Program Files\OpenSSH\sshd.exe�22�6�Inbound rule for OpenSSH SSH Server (sshd)
Property(N): INSTALLFOLDER = C:\Program Files\OpenSSH\
Property(N): SPDXFOLDER = C:\Program Files\OpenSSH\_manifest\spdx_2.2\
Property(N): SetPrivilegesOnSshAgent = "C:\WINDOWS\SysWOW64\sc.exe" privs ssh-agent SeAssignPrimaryTokenPrivilege/SeTcbPrivilege/SeBackupPrivilege/SeRestorePrivilege/SeImpersonatePrivilege
Property(N): UnregisterEventManifest = "wevtutil.exe" um "C:\Program Files\OpenSSH\openssh-events.man"
Property(N): RollbackUnregisterEventManifest = "wevtutil.exe" im "C:\Program Files\OpenSSH\openssh-events.man"
Property(N): SetPrivilegesOnSshd = "C:\WINDOWS\SysWOW64\sc.exe" privs sshd SeAssignPrimaryTokenPrivilege/SeTcbPrivilege/SeBackupPrivilege/SeRestorePrivilege/SeImpersonatePrivilege
Property(N): MANIFESTFOLDER = C:\Program Files\OpenSSH\_manifest\
Property(N): ProgramFiles64Folder = C:\Program Files\
Property(N): TARGETDIR = G:\
Property(N): VersionNT = 603
Property(N): ALLUSERS = 1
Property(N): ADD_PATH = 1
Property(N): Manufacturer = Microsoft Corporation
Property(N): ProductCode = {DF612DC9-F0C5-420C-B297-6DF941EEB7FE}
Property(N): ProductLanguage = 1033
Property(N): ProductName = OpenSSH
Property(N): ProductVersion = 9.2.2.0
Property(N): SecureCustomProperties = WIX_DOWNGRADE_DETECTED;WIX_UPGRADE_DETECTED
Property(N): MsiHiddenProperties = ExecXmlFile;ExecXmlFileRollback
Property(N): PackageCode = {BCCD7D56-02D0-4999-97A1-3E894561D5AA}
Property(N): ProductState = 5
Property(N): UPGRADINGPRODUCTCODE = {FDD29DE5-F491-4852-826B-5841F876E222}
Property(N): CLIENTPROCESSID = 38216
Property(N): CLIENTUILEVEL = 0
Property(N): REMOVE = ALL
Property(N): MsiSystemRebootPending = 1
Property(N): PRODUCTLANGUAGE = 1033
Property(N): VersionDatabase = 200
Property(N): VersionMsi = 5.00
Property(N): VersionNT64 = 603
Property(N): WindowsBuild = 9600
Property(N): ServicePackLevel = 0
Property(N): ServicePackLevelMinor = 0
Property(N): MsiNTProductType = 1
Property(N): WindowsFolder = C:\WINDOWS\
Property(N): WindowsVolume = C:\
Property(N): System64Folder = C:\WINDOWS\system32\
Property(N): SystemFolder = C:\WINDOWS\SysWOW64\
Property(N): RemoteAdminTS = 1
Property(N): TempFolder = C:\Users\<redacted>\AppData\Local\Temp\
Property(N): ProgramFilesFolder = C:\Program Files (x86)\
Property(N): CommonFilesFolder = C:\Program Files (x86)\Common Files\
Property(N): CommonFiles64Folder = C:\Program Files\Common Files\
Property(N): AppDataFolder = C:\Users\<redacted>\AppData\Roaming\
Property(N): FavoritesFolder = C:\Users\<redacted>\Favorites\
Property(N): NetHoodFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Network Shortcuts\
Property(N): PersonalFolder = D:\home\<redacted>\Cloud\<redacted>\Documents\
Property(N): PrintHoodFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Printer Shortcuts\
Property(N): RecentFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Recent\
Property(N): SendToFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\SendTo\
Property(N): TemplateFolder = C:\ProgramData\Microsoft\Windows\Templates\
Property(N): CommonAppDataFolder = C:\ProgramData\
Property(N): LocalAppDataFolder = C:\Users\<redacted>\AppData\Local\
Property(N): MyPicturesFolder = D:\home\<redacted>\Cloud\<redacted>\Images\
Property(N): AdminToolsFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\
Property(N): StartupFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\
Property(N): ProgramMenuFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\
Property(N): StartMenuFolder = C:\ProgramData\Microsoft\Windows\Start Menu\
Property(N): DesktopFolder = C:\Users\Public\Desktop\
Property(N): FontsFolder = C:\WINDOWS\Fonts\
Property(N): GPTSupport = 1
Property(N): OLEAdvtSupport = 1
Property(N): ShellAdvtSupport = 1
Property(N): MsiAMD64 = 25
Property(N): Msix64 = 25
Property(N): Intel = 25
Property(N): PhysicalMemory = 32683
Property(N): VirtualMemory = 48141
Property(N): AdminUser = 1
Property(N): MsiTrueAdminUser = 1
Property(N): LogonUser = <redacted>
Property(N): UserSID = S-1-5-21-1841667278-1669535891-1504620426-1001
Property(N): UserLanguageID = 1036
Property(N): ComputerName = IFRIT
Property(N): SystemLanguageID = 1033
Property(N): ScreenX = 1024
Property(N): ScreenY = 768
Property(N): CaptionHeight = 23
Property(N): BorderTop = 1
Property(N): BorderSide = 1
Property(N): MsiTabletPC = 1
Property(N): TextHeight = 16
Property(N): TextInternalLeading = 3
Property(N): ColorBits = 32
Property(N): TTCSupport = 1
Property(N): Time = 10:12:05
Property(N): Date = 11/10/2023
Property(N): MsiNetAssemblySupport = 4.8.9032.0
Property(N): MsiWin32AssemblySupport = 6.3.22621.1485
Property(N): RedirectedDllSupport = 2
Property(N): MsiRunningElevated = 1
Property(N): Privileged = 1
Property(N): USERNAME = <redacted>
Property(N): Installed = 00:00:00
Property(N): DATABASE = C:\WINDOWS\Installer\8102e7.msi
Property(N): OriginalDatabase = C:\WINDOWS\Installer\8102e7.msi
Property(N): UILevel = 5
Property(N): Preselected = 1
Property(N): ACTION = INSTALL
Property(N): ROOTDRIVE = G:\
Property(N): CostingComplete = 1
Property(N): OutOfDiskSpace = 0
Property(N): OutOfNoRbDiskSpace = 0
Property(N): PrimaryVolumeSpaceAvailable = 0
Property(N): PrimaryVolumeSpaceRequired = 0
Property(N): PrimaryVolumeSpaceRemaining = 0
Property(N): INSTALLLEVEL = 1
Action ended 10:12:05: RemoveExistingProducts. Return value 1.
Action start 10:12:05: ProcessComponents.
Action ended 10:12:05: ProcessComponents. Return value 1.
Action start 10:12:05: UnpublishFeatures.
Action ended 10:12:05: UnpublishFeatures. Return value 1.
Action start 10:12:05: StopServices.
Action ended 10:12:05: StopServices. Return value 1.
Action start 10:12:05: DeleteServices.
Action ended 10:12:05: DeleteServices. Return value 1.
Action start 10:12:05: RemoveRegistryValues.
Action ended 10:12:05: RemoveRegistryValues. Return value 1.
Action start 10:12:05: ConfigureEventManifestUnregister.
Action ended 10:12:05: ConfigureEventManifestUnregister. Return value 1.
Action start 10:12:05: RemoveEnvironmentStrings.
Action ended 10:12:05: RemoveEnvironmentStrings. Return value 1.
Action start 10:12:05: WixSchedFirewallExceptionsUninstall.
SchedFirewallExceptions:  Component 'sshd.exe' action state (1) doesn't match request (2)
SchedFirewallExceptions:  No firewall exceptions scheduled
Action ended 10:12:05: WixSchedFirewallExceptionsUninstall. Return value 1.
Action start 10:12:05: RemoveFiles.
Action ended 10:12:05: RemoveFiles. Return value 0.
Action start 10:12:05: InstallFiles.
Action ended 10:12:05: InstallFiles. Return value 1.
Action start 10:12:05: WixSchedFirewallExceptionsInstall.
SchedFirewallExceptions:  Scheduling firewall exception (1�OpenSSH SSH Server Preview (sshd)�2�*�0�2�C:\Program Files\OpenSSH\sshd.exe�22�6�Inbound rule for OpenSSH SSH Server (sshd))
Action start 10:12:05: WixRollbackFirewallExceptionsInstall.
Action ended 10:12:05: WixRollbackFirewallExceptionsInstall. Return value 1.
Action start 10:12:05: WixExecFirewallExceptionsInstall.
Action ended 10:12:05: WixExecFirewallExceptionsInstall. Return value 1.
Action ended 10:12:05: WixSchedFirewallExceptionsInstall. Return value 1.
Action start 10:12:05: DuplicateFiles.
Action ended 10:12:05: DuplicateFiles. Return value 1.
Action start 10:12:05: SchedXmlFile.
Action start 10:12:05: ExecXmlFile.
Action ended 10:12:05: ExecXmlFile. Return value 1.
Action ended 10:12:05: SchedXmlFile. Return value 1.
Action start 10:12:05: ConfigureEventManifestRegister.
Action start 10:12:05: RollbackRegisterEventManifest.
Action ended 10:12:05: RollbackRegisterEventManifest. Return value 1.
Action start 10:12:05: RegisterEventManifest.
Action ended 10:12:05: RegisterEventManifest. Return value 1.
Action ended 10:12:05: ConfigureEventManifestRegister. Return value 1.
Action start 10:12:05: WriteRegistryValues.
Action ended 10:12:05: WriteRegistryValues. Return value 1.
Action start 10:12:05: WriteEnvironmentStrings.
Action ended 10:12:05: WriteEnvironmentStrings. Return value 1.
Action start 10:12:05: InstallServices.
Action ended 10:12:05: InstallServices. Return value 1.
Action start 10:12:05: SchedServiceConfig.
Action start 10:12:05: RollbackServiceConfig.
Action ended 10:12:05: RollbackServiceConfig. Return value 1.
Action start 10:12:05: ExecServiceConfig.
Action ended 10:12:05: ExecServiceConfig. Return value 1.
Action ended 10:12:05: SchedServiceConfig. Return value 1.
Action start 10:12:05: SetSetPrivilegesOnSshAgent.
Action ended 10:12:05: SetSetPrivilegesOnSshAgent. Return value 1.
Action start 10:12:05: SetPrivilegesOnSshAgent.
Action ended 10:12:05: SetPrivilegesOnSshAgent. Return value 1.
Action start 10:12:05: SetSetPrivilegesOnSshd.
Action ended 10:12:05: SetSetPrivilegesOnSshd. Return value 1.
Action start 10:12:05: SetPrivilegesOnSshd.
Action ended 10:12:05: SetPrivilegesOnSshd. Return value 1.
Action start 10:12:05: StartServices.
Action ended 10:12:05: StartServices. Return value 1.
Action start 10:12:05: RegisterUser.
Action ended 10:12:05: RegisterUser. Return value 1.
Action start 10:12:05: RegisterProduct.
Action ended 10:12:05: RegisterProduct. Return value 1.
Action start 10:12:05: PublishFeatures.
Action ended 10:12:05: PublishFeatures. Return value 1.
Action start 10:12:05: PublishProduct.
Action ended 10:12:05: PublishProduct. Return value 1.
Action start 10:12:05: InstallFinalize.
ExecFirewallExceptions:  Installing firewall exception2 OpenSSH SSH Server Preview (sshd) (C:\Program Files\OpenSSH\sshd.exe)
WixQuietExec:   ChangeServiceConfig2 SUCCESS
WixQuietExec:   ChangeServiceConfig2 SUCCESS
Action ended 10:12:09: InstallFinalize. Return value 1.
Action ended 10:12:09: INSTALL. Return value 1.
Property(S): UpgradeCode = {9E9D0D93-E70D-4424-ADBD-AD3B226A226D}
Property(S): WixRollbackFirewallExceptionsInstall = 1�OpenSSH SSH Server Preview (sshd)�2�*�0�2�C:\Program Files\OpenSSH\sshd.exe�22�6�Inbound rule for OpenSSH SSH Server (sshd)
Property(S): WixExecFirewallExceptionsInstall = 1�OpenSSH SSH Server Preview (sshd)�2�*�0�2�C:\Program Files\OpenSSH\sshd.exe�22�6�Inbound rule for OpenSSH SSH Server (sshd)
Property(S): INSTALLFOLDER = C:\Program Files\OpenSSH\
Property(S): SPDXFOLDER = C:\Program Files\OpenSSH\_manifest\spdx_2.2\
Property(S): SetPrivilegesOnSshAgent = "C:\WINDOWS\SysWOW64\sc.exe" privs ssh-agent SeAssignPrimaryTokenPrivilege/SeTcbPrivilege/SeBackupPrivilege/SeRestorePrivilege/SeImpersonatePrivilege
Property(S): RegisterEventManifest = "wevtutil.exe" im "C:\Program Files\OpenSSH\openssh-events.man"
Property(S): RollbackRegisterEventManifest = "wevtutil.exe" um "C:\Program Files\OpenSSH\openssh-events.man"
Property(S): ExecXmlFile = **********
Property(S): ExecServiceConfig = SchedServiceConfig�ssh-agent�1�restart�restart�restart�1�0���sshd�1�restart�restart�restart�1�0��
Property(S): RollbackServiceConfig = SchedServiceConfig
Property(S): SetPrivilegesOnSshd = "C:\WINDOWS\SysWOW64\sc.exe" privs sshd SeAssignPrimaryTokenPrivilege/SeTcbPrivilege/SeBackupPrivilege/SeRestorePrivilege/SeImpersonatePrivilege
Property(S): MANIFESTFOLDER = C:\Program Files\OpenSSH\_manifest\
Property(S): ProgramFiles64Folder = C:\Program Files\
Property(S): TARGETDIR = G:\
Property(S): SourceDir = C:\Users\<redacted>\AppData\Local\Temp\WinGet\Microsoft.OpenSSH.Beta.9.4.0.0\
Property(S): VersionNT = 603
Property(S): ALLUSERS = 1
Property(S): ADD_PATH = 1
Property(S): Manufacturer = Microsoft Corporation
Property(S): ProductCode = {FDD29DE5-F491-4852-826B-5841F876E222}
Property(S): ProductLanguage = 1033
Property(S): ProductName = OpenSSH
Property(S): ProductVersion = 9.4.0.0
Property(S): SecureCustomProperties = WIX_DOWNGRADE_DETECTED;WIX_UPGRADE_DETECTED
Property(S): MsiHiddenProperties = ExecXmlFile;ExecXmlFileRollback
Property(S): WIX_UPGRADE_DETECTED = {DF612DC9-F0C5-420C-B297-6DF941EEB7FE}
Property(S): MsiLogFileLocation = C:\Users\<redacted>\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.OpenSSH.Beta.9.4.0.0-2023-10-11-10-09-55.409.log
Property(S): PackageCode = {9E482392-B51B-426A-B44C-98D4190B639B}
Property(S): ProductState = -1
Property(S): PackagecodeChanging = 1
Property(S): CURRENTDIRECTORY = C:\Program Files\gsudo\Current
Property(S): CLIENTUILEVEL = 0
Property(S): CLIENTPROCESSID = 38216
Property(S): USERNAME = <redacted>
Property(S): VersionDatabase = 200
Property(S): ROOTDRIVE = G:\
Property(S): MIGRATE = {DF612DC9-F0C5-420C-B297-6DF941EEB7FE}
Property(S): EXECUTEACTION = INSTALL
Property(S): ACTION = INSTALL
Property(S): INSTALLLEVEL = 1
Property(S): SECONDSEQUENCE = 1
Property(S): ADDLOCAL = Client,Server
Property(S): MsiSystemRebootPending = 1
Property(S): VersionMsi = 5.00
Property(S): VersionNT64 = 603
Property(S): WindowsBuild = 9600
Property(S): ServicePackLevel = 0
Property(S): ServicePackLevelMinor = 0
Property(S): MsiNTProductType = 1
Property(S): WindowsFolder = C:\WINDOWS\
Property(S): WindowsVolume = C:\
Property(S): System64Folder = C:\WINDOWS\system32\
Property(S): SystemFolder = C:\WINDOWS\SysWOW64\
Property(S): RemoteAdminTS = 1
Property(S): TempFolder = C:\Users\<redacted>\AppData\Local\Temp\
Property(S): ProgramFilesFolder = C:\Program Files (x86)\
Property(S): CommonFilesFolder = C:\Program Files (x86)\Common Files\
Property(S): CommonFiles64Folder = C:\Program Files\Common Files\
Property(S): AppDataFolder = C:\Users\<redacted>\AppData\Roaming\
Property(S): FavoritesFolder = C:\Users\<redacted>\Favorites\
Property(S): NetHoodFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Network Shortcuts\
Property(S): PersonalFolder = D:\home\<redacted>\Cloud\<redacted>\Documents\
Property(S): PrintHoodFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Printer Shortcuts\
Property(S): RecentFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Recent\
Property(S): SendToFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\SendTo\
Property(S): TemplateFolder = C:\ProgramData\Microsoft\Windows\Templates\
Property(S): CommonAppDataFolder = C:\ProgramData\
Property(S): LocalAppDataFolder = C:\Users\<redacted>\AppData\Local\
Property(S): MyPicturesFolder = D:\home\<redacted>\Cloud\<redacted>\Images\
Property(S): AdminToolsFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\
Property(S): StartupFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\
Property(S): ProgramMenuFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\
Property(S): StartMenuFolder = C:\ProgramData\Microsoft\Windows\Start Menu\
Property(S): DesktopFolder = C:\Users\Public\Desktop\
Property(S): FontsFolder = C:\WINDOWS\Fonts\
Property(S): GPTSupport = 1
Property(S): OLEAdvtSupport = 1
Property(S): ShellAdvtSupport = 1
Property(S): MsiAMD64 = 25
Property(S): Msix64 = 25
Property(S): Intel = 25
Property(S): PhysicalMemory = 32683
Property(S): VirtualMemory = 47535
Property(S): AdminUser = 1
Property(S): MsiTrueAdminUser = 1
Property(S): LogonUser = <redacted>
Property(S): UserSID = S-1-5-21-1841667278-1669535891-1504620426-1001
Property(S): UserLanguageID = 1036
Property(S): ComputerName = IFRIT
Property(S): SystemLanguageID = 1033
Property(S): ScreenX = 1024
Property(S): ScreenY = 768
Property(S): CaptionHeight = 23
Property(S): BorderTop = 1
Property(S): BorderSide = 1
Property(S): MsiTabletPC = 1
Property(S): TextHeight = 16
Property(S): TextInternalLeading = 3
Property(S): ColorBits = 32
Property(S): TTCSupport = 1
Property(S): Time = 10:12:09
Property(S): Date = 11/10/2023
Property(S): MsiNetAssemblySupport = 4.8.9032.0
Property(S): MsiWin32AssemblySupport = 6.3.22621.1485
Property(S): RedirectedDllSupport = 2
Property(S): MsiRunningElevated = 1
Property(S): Privileged = 1
Property(S): DATABASE = C:\WINDOWS\Installer\40e20b.msi
Property(S): OriginalDatabase = C:\Users\<redacted>\AppData\Local\Temp\WinGet\Microsoft.OpenSSH.Beta.9.4.0.0\OpenSSH-Win64-v9.4.0.0.msi
Property(S): UILevel = 5
Property(S): Preselected = 1
Property(S): CostingComplete = 1
Property(S): OutOfDiskSpace = 0
Property(S): OutOfNoRbDiskSpace = 0
Property(S): PrimaryVolumeSpaceAvailable = 0
Property(S): PrimaryVolumeSpaceRequired = 0
Property(S): PrimaryVolumeSpaceRemaining = 0
Property(S): SOURCEDIR = C:\Users\<redacted>\AppData\Local\Temp\WinGet\Microsoft.OpenSSH.Beta.9.4.0.0\
Property(S): SourcedirProduct = {FDD29DE5-F491-4852-826B-5841F876E222}
Property(S): ProductToBeRegistered = 1
Action ended 10:12:09: ExecuteAction. Return value 1.
Action ended 10:12:09: INSTALL. Return value 1.
Property(C): UpgradeCode = {9E9D0D93-E70D-4424-ADBD-AD3B226A226D}
Property(C): INSTALLFOLDER = C:\Program Files\OpenSSH\
Property(C): SPDXFOLDER = C:\Program Files\OpenSSH\_manifest\spdx_2.2\
Property(C): MANIFESTFOLDER = C:\Program Files\OpenSSH\_manifest\
Property(C): ProgramFiles64Folder = C:\Program Files\
Property(C): TARGETDIR = G:\
Property(C): SourceDir = C:\Users\<redacted>\AppData\Local\Temp\WinGet\Microsoft.OpenSSH.Beta.9.4.0.0\
Property(C): VersionNT = 603
Property(C): ALLUSERS = 1
Property(C): ADD_PATH = 1
Property(C): Manufacturer = Microsoft Corporation
Property(C): ProductCode = {FDD29DE5-F491-4852-826B-5841F876E222}
Property(C): ProductLanguage = 1033
Property(C): ProductName = OpenSSH
Property(C): ProductVersion = 9.4.0.0
Property(C): SecureCustomProperties = WIX_DOWNGRADE_DETECTED;WIX_UPGRADE_DETECTED
Property(C): MsiHiddenProperties = ExecXmlFile;ExecXmlFileRollback
Property(C): WIX_UPGRADE_DETECTED = {DF612DC9-F0C5-420C-B297-6DF941EEB7FE}
Property(C): MsiLogFileLocation = C:\Users\<redacted>\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.OpenSSH.Beta.9.4.0.0-2023-10-11-10-09-55.409.log
Property(C): PackageCode = {9E482392-B51B-426A-B44C-98D4190B639B}
Property(C): ProductState = -1
Property(C): PackagecodeChanging = 1
Property(C): CURRENTDIRECTORY = C:\Program Files\gsudo\Current
Property(C): CLIENTUILEVEL = 0
Property(C): CLIENTPROCESSID = 38216
Property(C): MsiSystemRebootPending = 1
Property(C): VersionDatabase = 200
Property(C): VersionMsi = 5.00
Property(C): VersionNT64 = 603
Property(C): WindowsBuild = 9600
Property(C): ServicePackLevel = 0
Property(C): ServicePackLevelMinor = 0
Property(C): MsiNTProductType = 1
Property(C): WindowsFolder = C:\WINDOWS\
Property(C): WindowsVolume = C:\
Property(C): System64Folder = C:\WINDOWS\system32\
Property(C): SystemFolder = C:\WINDOWS\SysWOW64\
Property(C): RemoteAdminTS = 1
Property(C): TempFolder = C:\Users\<redacted>\AppData\Local\Temp\
Property(C): ProgramFilesFolder = C:\Program Files (x86)\
Property(C): CommonFilesFolder = C:\Program Files (x86)\Common Files\
Property(C): CommonFiles64Folder = C:\Program Files\Common Files\
Property(C): AppDataFolder = C:\Users\<redacted>\AppData\Roaming\
Property(C): FavoritesFolder = C:\Users\<redacted>\Favorites\
Property(C): NetHoodFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Network Shortcuts\
Property(C): PersonalFolder = D:\home\<redacted>\Cloud\<redacted>\Documents\
Property(C): PrintHoodFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Printer Shortcuts\
Property(C): RecentFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\Recent\
Property(C): SendToFolder = C:\Users\<redacted>\AppData\Roaming\Microsoft\Windows\SendTo\
Property(C): TemplateFolder = C:\ProgramData\Microsoft\Windows\Templates\
Property(C): CommonAppDataFolder = C:\ProgramData\
Property(C): LocalAppDataFolder = C:\Users\<redacted>\AppData\Local\
Property(C): MyPicturesFolder = D:\home\<redacted>\Cloud\<redacted>\Images\
Property(C): AdminToolsFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\
Property(C): StartupFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\
Property(C): ProgramMenuFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\
Property(C): StartMenuFolder = C:\ProgramData\Microsoft\Windows\Start Menu\
Property(C): DesktopFolder = C:\Users\Public\Desktop\
Property(C): FontsFolder = C:\WINDOWS\Fonts\
Property(C): GPTSupport = 1
Property(C): OLEAdvtSupport = 1
Property(C): ShellAdvtSupport = 1
Property(C): MsiAMD64 = 25
Property(C): Msix64 = 25
Property(C): Intel = 25
Property(C): PhysicalMemory = 32683
Property(C): VirtualMemory = 47586
Property(C): AdminUser = 1
Property(C): MsiTrueAdminUser = 1
Property(C): LogonUser = <redacted>
Property(C): UserSID = S-1-5-21-1841667278-1669535891-1504620426-1001
Property(C): UserLanguageID = 1036
Property(C): ComputerName = IFRIT
Property(C): SystemLanguageID = 1033
Property(C): ScreenX = 2560
Property(C): ScreenY = 1440
Property(C): CaptionHeight = 23
Property(C): BorderTop = 1
Property(C): BorderSide = 1
Property(C): MsiTabletPC = 1
Property(C): TextHeight = 16
Property(C): TextInternalLeading = 3
Property(C): ColorBits = 32
Property(C): TTCSupport = 1
Property(C): Time = 10:12:09
Property(C): Date = 11/10/2023
Property(C): MsiNetAssemblySupport = 4.8.9032.0
Property(C): MsiWin32AssemblySupport = 6.3.22621.1485
Property(C): RedirectedDllSupport = 2
Property(C): MsiRunningElevated = 1
Property(C): Privileged = 1
Property(C): USERNAME = <redacted>
Property(C): DATABASE = C:\Users\<redacted>\AppData\Local\Temp\WinGet\Microsoft.OpenSSH.Beta.9.4.0.0\OpenSSH-Win64-v9.4.0.0.msi
Property(C): OriginalDatabase = C:\Users\<redacted>\AppData\Local\Temp\WinGet\Microsoft.OpenSSH.Beta.9.4.0.0\OpenSSH-Win64-v9.4.0.0.msi
Property(C): SOURCEDIR = C:\Users\<redacted>\AppData\Local\Temp\WinGet\Microsoft.OpenSSH.Beta.9.4.0.0\
Property(C): VersionHandler = 5.00
Property(C): ROOTDRIVE = G:\
Property(C): MIGRATE = {DF612DC9-F0C5-420C-B297-6DF941EEB7FE}
Property(C): EXECUTEACTION = INSTALL
Property(C): ACTION = INSTALL
Property(C): UILevel = 5
Property(C): CostingComplete = 0
Property(C): OutOfDiskSpace = 0
Property(C): OutOfNoRbDiskSpace = 0
Property(C): PrimaryVolumeSpaceAvailable = 0
Property(C): PrimaryVolumeSpaceRequired = 0
Property(C): PrimaryVolumeSpaceRemaining = 0
Property(C): INSTALLLEVEL = 1
=== Logging stopped: 11/10/2023  10:12:09 ===
MSI (c) (48:D0) [10:12:09:418]: Product: OpenSSH -- Installation completed successfully.

MSI (c) (48:D0) [10:12:09:418]: Windows Installer installed the product. Product Name: OpenSSH. Product Version: 9.4.0.0. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0.


@tgauth
Copy link
Collaborator

tgauth commented Oct 11, 2023

I tried running manually the PowerShell script here (https://github.com/PowerShell/openssh-portable/blob/latestw_all/contrib/win32/openssh/install-sshd.ps1) and it fixed the situation somehow, even though I still have an error at the end of the install process.

Thanks for confirming that running the install script works, @Murazaki.

@user8446, can you confirm the $env:SystemDrive\ProgramData\ssh folder permissions match what's expected by sshd for startup?

@tgauth tgauth pinned this issue Oct 11, 2023
@tgauth tgauth unpinned this issue Oct 11, 2023
@tgauth tgauth transferred this issue from PowerShell/openssh-portable Oct 11, 2023
@user8446
Copy link
Author

@user8446, can you confirm the $env:SystemDrive\ProgramData\ssh folder permissions match what's expected by sshd for startup?

Yes just SYSTEM & admin have write access

@tgauth
Copy link
Collaborator

tgauth commented Oct 11, 2023

@user8446, can you confirm the $env:SystemDrive\ProgramData\ssh folder permissions match what's expected by sshd for startup?

Yes just SYSTEM & admin have write access

Ok, thanks.

What's the error number when trying to start sshd?
Also, are able to start sshd in debug mode (sshd -ddd)?

@user8446
Copy link
Author

v9.4.0 doesn't even start at all:

PS C:\Windows\System32> Start-Service -Name "sshd"
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...
WARNING: Waiting for service 'OpenSSH SSH Server (sshd)' to start...

v9.2.0 does start:

PS C:\Windows\System32> Start-Service -Name "sshd"
PS C:\Windows\System32> Get-Service -Name "sshd"

Status   Name               DisplayName
------   ----               -----------
Running  sshd               OpenSSH SSH Server

Debug info isn't a help here as neither version starts with -ddd, is there a trick to that?

v9.4.0:

debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug3: w32_fstat ERROR: bad fd: 3
debug2: load_server_config: done config len = 2911
debug2: parse_server_config_depth: config __PROGRAMDATA__\\ssh/sshd_config len 2911
debug3: __PROGRAMDATA__\\ssh/sshd_config:12 setting Port <redacted>
debug3: __PROGRAMDATA__\\ssh/sshd_config:13 setting AddressFamily inet
debug3: __PROGRAMDATA__\\ssh/sshd_config:34 setting RekeyLimit 6G none
debug3: __PROGRAMDATA__\\ssh/sshd_config:37 setting SyslogFacility LOCAL0
debug3: __PROGRAMDATA__\\ssh/sshd_config:38 setting LogLevel INFO
debug3: __PROGRAMDATA__\\ssh/sshd_config:41 setting AuthenticationMethods publickey
debug3: __PROGRAMDATA__\\ssh/sshd_config:42 setting LoginGraceTime 7s
debug3: __PROGRAMDATA__\\ssh/sshd_config:45 setting MaxAuthTries 1
debug3: __PROGRAMDATA__\\ssh/sshd_config:69 setting PasswordAuthentication no
debug3: __PROGRAMDATA__\\ssh/sshd_config:84 setting ClientAliveInterval 15
debug3: __PROGRAMDATA__\\ssh/sshd_config:85 setting ClientAliveCountMax 3
debug1: sshd version OpenSSH_for_Windows_9.4, LibreSSL 3.7.3
debug1: get_passwd: lookup_sid() failed: 1332.
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_rsa_key error:5
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_rsa_key error:13
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_rsa_key.pub error:13
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_rsa_key error:5
debug1: Unable to load host key: __PROGRAMDATA__\\ssh/ssh_host_rsa_key
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_ecdsa_key error:5
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_ecdsa_key error:13
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_ecdsa_key.pub error:13
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_ecdsa_key error:5
debug1: Unable to load host key: __PROGRAMDATA__\\ssh/ssh_host_ecdsa_key
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_ed25519_key error:5
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_ed25519_key error:13
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_ed25519_key.pub error:13
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_ed25519_key error:5
debug1: Unable to load host key: __PROGRAMDATA__\\ssh/ssh_host_ed25519_key
sshd: no hostkeys available -- exiting.

v9.2.0:

debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug3: w32_fstat ERROR: bad fd: 3
debug2: load_server_config: done config len = 2911
debug2: parse_server_config_depth: config __PROGRAMDATA__\\ssh/sshd_config len 2911
debug3: __PROGRAMDATA__\\ssh/sshd_config:12 setting Port <redacted>
debug3: __PROGRAMDATA__\\ssh/sshd_config:13 setting AddressFamily inet
debug3: __PROGRAMDATA__\\ssh/sshd_config:34 setting RekeyLimit 6G none
debug3: __PROGRAMDATA__\\ssh/sshd_config:37 setting SyslogFacility LOCAL0
debug3: __PROGRAMDATA__\\ssh/sshd_config:38 setting LogLevel INFO
debug3: __PROGRAMDATA__\\ssh/sshd_config:41 setting AuthenticationMethods publickey
debug3: __PROGRAMDATA__\\ssh/sshd_config:42 setting LoginGraceTime 7s
debug3: __PROGRAMDATA__\\ssh/sshd_config:45 setting MaxAuthTries 1
debug3: __PROGRAMDATA__\\ssh/sshd_config:69 setting PasswordAuthentication no
debug3: __PROGRAMDATA__\\ssh/sshd_config:84 setting ClientAliveInterval 15
debug3: __PROGRAMDATA__\\ssh/sshd_config:85 setting ClientAliveCountMax 3
debug1: sshd version OpenSSH_for_Windows_9.2, LibreSSL 3.7.3
debug1: get_passwd: lookup_sid() failed: 1332.
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_rsa_key error:5
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_rsa_key error:13
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_rsa_key.pub error:13
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_rsa_key error:5
debug1: Unable to load host key: __PROGRAMDATA__\\ssh/ssh_host_rsa_key
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_ecdsa_key error:5
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_ecdsa_key error:13
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_ecdsa_key.pub error:13
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_ecdsa_key error:5
debug1: Unable to load host key: __PROGRAMDATA__\\ssh/ssh_host_ecdsa_key
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_ed25519_key error:5
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_ed25519_key error:13
debug3: Failed to open file:C:/ProgramData/ssh/ssh_host_ed25519_key.pub error:13
debug3: failed to open file:C:/ProgramData/ssh/ssh_host_ed25519_key error:5
debug1: Unable to load host key: __PROGRAMDATA__\\ssh/ssh_host_ed25519_key
sshd: no hostkeys available -- exiting.

@tgauth
Copy link
Collaborator

tgauth commented Oct 11, 2023

Try running sshd -ddd from an elevated command prompt, I think it's unable to load the hostkeys so it can't start in debug mode.

https://github.com/PowerShell/Win32-OpenSSH/wiki/Troubleshooting-Steps

@user8446
Copy link
Author

C:\windows\system32>"C:\Program Files\OpenSSH\sshd.exe" -ddd
debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug3: w32_fstat ERROR: bad fd: 3
debug2: load_server_config: done config len = 2911
debug2: parse_server_config_depth: config __PROGRAMDATA__\\ssh/sshd_config len 2911
debug3: __PROGRAMDATA__\\ssh/sshd_config:12 setting Port <redacted>
debug3: __PROGRAMDATA__\\ssh/sshd_config:13 setting AddressFamily inet
debug3: __PROGRAMDATA__\\ssh/sshd_config:34 setting RekeyLimit 6G none
debug3: __PROGRAMDATA__\\ssh/sshd_config:37 setting SyslogFacility LOCAL0
debug3: __PROGRAMDATA__\\ssh/sshd_config:38 setting LogLevel INFO
debug3: __PROGRAMDATA__\\ssh/sshd_config:41 setting AuthenticationMethods publickey
debug3: __PROGRAMDATA__\\ssh/sshd_config:42 setting LoginGraceTime 7s
debug3: __PROGRAMDATA__\\ssh/sshd_config:45 setting MaxAuthTries 1
debug3: __PROGRAMDATA__\\ssh/sshd_config:69 setting PasswordAuthentication no
debug3: __PROGRAMDATA__\\ssh/sshd_config:84 setting ClientAliveInterval 15
debug3: __PROGRAMDATA__\\ssh/sshd_config:85 setting ClientAliveCountMax 3
debug1: sshd version OpenSSH_for_Windows_9.4, LibreSSL 3.7.3
debug1: get_passwd: lookup_sid() failed: 1332.
debug1: private host key #0: ssh-rsa SHA256:<redacted>
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:<redacted>
debug1: private host key #2: ssh-ed25519 SHA256:<redacted>
debug1: rexec_argv[0]='C:\\Program Files\\OpenSSH\\sshd.exe'
debug1: rexec_argv[1]='-ddd'
debug2: fd 3 setting O_NONBLOCK
debug1: Bind to port <redacted> on 0.0.0.0.
Server listening on 0.0.0.0 port <redacted>.
debug3: pselect: installing signal handler for 3, previous 00007FF6FBB98050
debug3: pselect: installing signal handler for 6, previous 00007FF6FBB97F50
debug3: pselect: installing signal handler for 7, previous 00007FF6FBB98040
debug3: pselect: installing signal handler for 8, previous 00007FF6FBB98040
debug3: pselect_notify_setup: initializing
debug2: fd 6 setting O_NONBLOCK
debug2: fd 4 setting O_NONBLOCK
debug3: pselect_notify_setup: pid 6892 saved 6892 pipe0 6 pipe1 4

@tgauth
Copy link
Collaborator

tgauth commented Oct 12, 2023

Ok, that's what I'd expect to see.

Could you try running the install-sshd.ps1 (or just the part that verifies the files permissions on the $env:SystemDrive\ProgramData\ssh folder)?

I'd also try starting directly with net start sshd to see if it still hangs, or gives an error number. I'm not sure it's reaching the point of logging, but can you check if there's anything in $env:SystemDrive\ProgramData\ssh\logs\sshd.log?

@user8446
Copy link
Author

Ok I put install-sshd.ps1 in $env:SystemDrive\Program Files\OpenSSH and after running from there v9.4.0 does run. Although permission were correct on the $env:SystemDrive\ProgramData\ssh folder, the script denied all permissions on the logs as well - even read. Is this expected? I re-enabled read for the logs.

@tgauth
Copy link
Collaborator

tgauth commented Oct 12, 2023

It should permit read access for authenticated users - were those types of accounts removed?

@user8446
Copy link
Author

I ran the script again and it stripped permissions again. I just manually add read permissions back to have access to the logs. I haven't had time to look at the PS code in the script.

Also just adding that when sshd.exe wouldn't start it never got to the point of logging so there was nothing in sshd.log.

My sshd server is up and running as expected but happy to help test anything like re-running the MSI installer before closing?

@tgauth
Copy link
Collaborator

tgauth commented Oct 13, 2023

I ran the script again and it stripped permissions again. I just manually add read permissions back to have access to the logs. I haven't had time to look at the PS code in the script.

Ok, I think this can be opened as a separate issue to fine tune the permissions of the install script.

Also just adding that when sshd.exe wouldn't start it never got to the point of logging so there was nothing in sshd.log.

Yeah, that's the expected behavior unfortunately. I didn't expect it to hang though - I'm not sure if that's due to using Start-Service vs net start sshd
With the latter, a system error 1067 has occurred is displayed.

My sshd server is up and running as expected but happy to help test anything like re-running the MSI installer before closing?

Great! If you feel like retrying the MSI installer with the current folder permissions, that would confirm it installs as expected. If you don't want to mess with your current setup, that's fine, too - I think we're good to close.

@user8446
Copy link
Author

I just ran the installer and all is well, the permissions persisted. Thank you very much helping out @tgauth !

@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Nov 2, 2023

i get this error . service sshd failed to start trying to update from 9.2.2 to 9.4 via msi . also it fails updating via winget
image

@tgauth
Copy link
Collaborator

tgauth commented Nov 2, 2023

@Uj947nXmRqV2nRaWshKtHzTvckUUpD can you confirm that only the Administrators group and the SYSTEM account have owner/write permissions on the $env:SystemDrive\ProgramData\ssh folder?

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

i must mention that in the past i used this commands as admin:
icacls.exe "C:\ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"

and later:
cd 'C:\Program Files\OpenSSH'
.\FixHostFilePermissions.ps1
.\FixUserFilePermissions.ps1

@tgauth
Copy link
Collaborator

tgauth commented Nov 2, 2023

Thanks for confirming - I just deleted the comment so the previous edits of the screenshot aren't accessible.

Does running install-sshd.ps1 ask to remove permissions on any other files within $env:SystemDrive\ProgramData\ssh?

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

Thanks for confirming - I just deleted the comment so the previous edits of the screenshot aren't accessible.

Does running install-sshd.ps1 ask to remove permissions on any other files within $env:SystemDrive\ProgramData\ssh?

could you please give me some more detailed instructions to do so ? where do i get that script and how do i run it?

@tgauth
Copy link
Collaborator

tgauth commented Nov 2, 2023

The script can be downloaded with a .zip release - https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.4.0.0p1-Beta/OpenSSH-Win64.zip or from https://github.com/PowerShell/openssh-portable/blob/latestw_all/contrib/win32/openssh/install-sshd.ps1.

Put the script in the same directory as the SSHD install - $env:ProgramFiles\OpenSSH\

Invoke the script from PowerShell - .\install-sshd.ps1

@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Nov 2, 2023

after running the script as admin i was able to update openssh via winget. thank you !

shouldn't this fix be added during install/update time?

@tgauth
Copy link
Collaborator

tgauth commented Nov 2, 2023

agreed - any chance you can pinpoint what permissions were changed by the script that ultimately permitted SSHD to start?

@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Nov 2, 2023

agreed - any chance you can pinpoint what permissions were changed by the script that ultimately permitted SSHD to start?

PS C:\Program Files\OpenSSH> .\install-sshd.ps1

Do you want to run software from this untrusted publisher?
File C:\Program Files\OpenSSH\install-sshd.ps1 is published by CN=Microsoft Corporation, O=Microsoft Corporation,
L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run  [D] Do not run  [R] Run once  [A] Always run  [?] Help (default is "D"): r
  [*] C:\Program Files\OpenSSH\moduli
'Everyone' now has Read access to 'C:\Program Files\OpenSSH\moduli'.
      Repaired permissions

  [*] C:\ProgramData\ssh
      looks good

  [*] C:\ProgramData\ssh\logs
'<PC>\<USER>' has no more access to 'C:\ProgramData\ssh\logs'.
      Repaired permissions

  [*] C:\ProgramData\ssh\administrators_authorized_keys
      looks good

  [*] C:\ProgramData\ssh\ssh_host_dsa_key.pub
      looks good

  [*] C:\ProgramData\ssh\ssh_host_ecdsa_key.pub
      looks good

  [*] C:\ProgramData\ssh\ssh_host_ed25519_key.pub
      looks good

  [*] C:\ProgramData\ssh\ssh_host_rsa_key.pub
      looks good

  [*] C:\ProgramData\ssh\sshd_config
      looks good

  [*] C:\ProgramData\ssh\sshd.pid
      looks good

  [*] C:\ProgramData\ssh\ssh_host_dsa_key
      looks good

  [*] C:\ProgramData\ssh\ssh_host_ecdsa_key
      looks good

  [*] C:\ProgramData\ssh\ssh_host_ed25519_key
      looks good

  [*] C:\ProgramData\ssh\ssh_host_rsa_key
      looks good

[SC] SetServiceObjectSecurity SUCCESS
[SC] ChangeServiceConfig2 SUCCESS
[SC] ChangeServiceConfig2 SUCCESS
sshd and ssh-agent services successfully installed

I replaced with <USER> in the install log. looks like moduli and logs folders

@sitiom
Copy link
Contributor

sitiom commented Dec 19, 2023

I still had the same error on v9.5.0.0p1-Beta, and I can confirm that running install-sshd.ps1 solved the issue. Hopefully, the fix can be added to the installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants