Appearance
To enable the SSH agent's system service on MS Windows:
- Open
services.msc
(just type it in the "Run" dialog fromWin+R
) - Find the service named "OpenSSH Authentication Agent"
- Rigth click and on its properties, set its "Startup type" to "Automatic"
- Apply, then press "Start" to run the service.
However, the OpenSSH that's shipped with Windows has some issues.
WARNING
As of Windows 10 version 21H1 the issue with the OpenSSH version included with Windows has been resolved. So now the ssh-agent that is located in C:\Windows\System32\OpenSSH\ssh-agent.exe
should work and be configured already by default.
To confirm whether it's correctly set in the registry, you can run the following command from Powershell:
powershell
Get-Itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\ssh-agent'
If it were not, but ssh-agent.exe is present, you may set it as follows:
powershell
Set-Itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\ssh-agent' -Name 'ImagePath' -value "$([Environment]::SystemDirectory)/OpenSSH/ssh-agent.exe"
However, if you are using an earlier version of Windows or you have any other problem, the instructions below should also work.
Download the latest OpenSSH component zip from Microsoft on Github.
Extract it to your chosen location (eg. C:\tools\OpenSSH-Win64\
) then run the below command in a Powershell terminal (change the ssh-agent.exe
path to your location)):
powershell
Set-Itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\ssh-agent' -Name 'ImagePath' -value 'C:\tools\OpenSSH-Win64\ssh-agent.exe'
Set-Itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\sshd' -Name 'ImagePath' -value 'C:\tools\OpenSSH-Win64\sshd.exe'