Windows Service

Windows 10 has a beta which allows for sshd and ssh-agent use to access the windows system. This covers the manual installation process, there is also a beta you may install via optional features.

Download OpenSSH Binaries and extract to c:\Program Files\.

Install OpenSSH, generate host keys, set file permissions, and open firewall port 22 (powershell as admin).
cd c:\Program Files\OpenSSH
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
./ssh-keygen.exe -A
powershell.exe -ExecutionPolicy Bypass -File ./FixHostFilePermissions.ps1
New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH
Enable sshd service

⌘ › services.msc › SSHD › General

Service name

sshd

Startup type

AUTOMATIC

Service status

STARTED

Updated: 2021-02-19

Set up publickey authentication:

  • Create c:\Users\{USER}\.ssh.

Grant SSHD service read permissions to .ssh directory.
icacls c:\users\{USER}\.ssh /grant "NT Service\sshd:R" /T

Reference