Windows
Enable SSHD
⌘ + r ➔ ms-settings:optionalfeatures ➔ OpenSSH ➔ Install
⌘ ➔ services.msc ➔ OpenSSH SSH Server
- Startup type: {AUTOMATIC}
Allow SSH through Windows Firewall
# Run as administrator.
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Set up publickey authentication
Grant SSHD service read permissions to .ssh directory.
mkdir c:\Users\{USER}\.ssh
icacls c:\users\{USER}\.ssh /grant "NT Service\sshd:R" /T