===== USAGE ====== Add-WindowsCapability -Online -Name OpenSSH.Client* Add-WindowsCapability -Online -Name OpenSSH.Server* Get-WindowsCapability -Online | ? Name -like 'OpenSSH*' Name : OpenSSH.Client~~~~0.0.1.0 State : Installed Name : OpenSSH.Server~~~~0.0.1.0 State : NotPresent Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 Start-Service sshd # Start-Service : Failed to start service 'OpenSSH SSH Server (sshd)'. ((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion) 7.7.2.2 * https://docs.microsoft.com/fr-fr/powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core?view=powershell-7# SsH * https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse * https://serverfault.com/questions/904430/cannot-start-sshd-service-failed-to-start-openssh-service-unit-not-found ===== ERRROR ===== PS C:\Windows\system32> Start-Service sshd Start-Service : Failed to start service 'OpenSSH SSH Server (sshd)'. At line:1 char:1 + Start-Service sshd + ~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand net start sshd The OpenSSH SSH Server service is starting. The OpenSSH SSH Server service could not be started. A system error has occurred. System error 1067 has occurred. The process terminated unexpectedly. * https://github.com/PowerShell/Win32-OpenSSH/issues/55 * https://github.com/PowerShell/Win32-OpenSSH/wiki/Security-protection-of-various-files-in-Win32-OpenSSH#host-private-key-files# Solution here PS C:\>(get-acl .\ssh_host_dsa_key).owner otheruser PS C:\>icacls .\ssh_host_dsa_key ssh_host_dsa_key NT AUTHORITY\SYSTEM:(F) BUILTIN\Administrators:(F) otheruser:(R) Steps to fix these permissions PS C:\>icacls .\ssh_host_dsa_key /setowner system PS C:\>icacls .\ssh_host_dsa_key /remove otheruser At this point, you could do the following to replicate these permissions onto other host keys PS C:\>get-acl .\ssh_host_dsa_key | Set-Acl ssh_host*key