- Open Admin PowerShell
- Run the following command
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
- Enable the services
Set-Service -Name ssh-agent -StartupType `Automatic`
Set-Service -Name sshd -StartupType `Automatic`
- Start both services
Start-Service ssh-agent
Start-Service sshd
- Public keys go here
C:\ProgramData\ssh\administrators_authorized_keys
- Remove
AuthenticatedUsers
permission from aforementioned fileC:\ProgramData\ssh\administrators_authorized_keys
- Open
C:\ProgramData\ssh\sshd_config
- Change the line that says
#PubkeyAuthentication
to remove the Pound Sign (Hash Tag for you youngins) - Change the line that says
#PasswordAuthentication
yes to PasswordAuthentication no (And remove the Pound Sign) - Save the file
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force
Restart both services to avoid a reboot of the computer
Restart-Service ssh-agent
Restart-Service sshd