Add-WindowsCapability -Online -Name OpenSSH.Client*
Add-WindowsCapability -Online -Name OpenSSH.Server*

Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
Name  : OpenSSH.Client~~~~
State : Installed

Name  : OpenSSH.Server~~~~
State : NotPresent

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~
Start-Service sshd
# Start-Service : Failed to start service 'OpenSSH SSH Server (sshd)'.

((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)


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],
    + 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.
PS C:\>(get-acl .\ssh_host_dsa_key).owner
PS C:\>icacls .\ssh_host_dsa_key
ssh_host_dsa_key   NT AUTHORITY\SYSTEM:(F)
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
powershell.txt · Last modified: 2020/09/08 20:47 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki