# Run as Admin in PowerShell # Download and extract OpenSSH-Win64 mkdir C:\openssh-install cd C:\openssh-install [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Invoke-WebRequest -Uri "https://github.com/PowerShell/Win32-OpenSSH/releases/latest/download/OpenSSH-Win64.zip" -OutFile .\openssh.zip Expand-Archive .\openssh.zip -DestinationPath .\openssh\ Move-Item .\openssh\OpenSSH-Win64 "C:\Program Files\OpenSSH-Win64" -Force # Add to system PATH setx PATH "$env:path;C:\Program Files\OpenSSH-Win64\" -m # Install the sshd + ssh-agent services cd "C:\Program Files\OpenSSH-Win64" powershell.exe -ExecutionPolicy Bypass -File .\install-sshd.ps1 # Generate host keys mkdir C:\ProgramData\ssh .\ssh-keygen.exe -A # Fix file perms .\FixHostFilePermissions.ps1 -Confirm:$false # Service Set-Service sshd -StartupType Automatic Set-Service ssh-agent -StartupType Automatic Start-Service sshd Start-Service ssh-agent