Don't ask. I dislike Windows.
-
Recursively take ownership administrator group
TAKEOWN /F "C:\WINDOWS\System32\OpenSSH" /R TAKEOWN /F "C:\WINDOWS\System32\OpenSSH" /A /R
-
Reset permissions, then grant full to users
ICACLS "C:\WINDOWS\System32\OpenSSH" /T /Q /C /RESET ICACLS "C:\WINDOWS\System32\OpenSSH" /grant:r "users:(F)" /C /T
-
Service configuration
Set-Service sshd -StartupType Automatic Set-Service ssh-agent -StartupType Automatic
Start-Service sshd Start-Service ssh-agent
Get-Service sshd Get-Service ssh-agent
-
Securing keys
Install-Module -Force OpenSSHUtils Repair-SshdHostKeyPermission -FilePath C:\Windows\System32\OpenSSH\ssh_host_ed25519_key
-
Helpful debug steps
It is helpful to manually run sshd with debug output enabled.
Stop-Service sshd
sshd -d
-
Open firewall port
netsh advfirewall firewall add rule name="Tunnel TCP Port 2022" dir=in action=allow protocol=TCP localport=2022 netsh advfirewall firewall add rule name="Tunnel TCP Port 2022" dir=out action=allow protocol=TCP localport=2022