Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058"

When I try to start the ssh-agent on Windows 10 via PowerShell (with elevated right or without) by entering Start-Service ssh-agent I get the error

unable to start ssh-agent service, error :1058

When I check of the service is running via Get-Service ssh-agent is returns that the service is stopped.

How can I get the ssh-agent running?

like image 653
quervernetzt Avatar asked Aug 31 '18 10:08

quervernetzt


People also ask

Could not open a connection to your authentication agent SSH-add Windows?

Could not open a connection to your authentication agent on Windows? You can just restart agent by eval ssh-agent -s and add older key using ssh-add ~/. ssh/id_rsa. If you generate new SSH key then you will need to update that key in all your services such as github, bitbucket, etc.


2 Answers

Yeah, as others have suggested, this error seems to mean that ssh-agent is installed but its service (on windows) hasn't been started.

You can check this by running in Windows PowerShell:

> Get-Service ssh-agent 

And then check the output of status is not running.

Status   Name               DisplayName ------   ----               ----------- Stopped  ssh-agent          OpenSSH Authentication Agent 

Then check that the service has been disabled by running

> Get-Service ssh-agent | Select StartType  StartType --------- Disabled 

I suggest setting the service to start manually. This means that as soon as you run ssh-agent, it'll start the service. You can do this through the Services GUI or you can run the command in admin mode:

 > Get-Service -Name ssh-agent | Set-Service -StartupType Manual 

Alternatively, you can set it through the GUI if you prefer.

services.msc showing the properties of the OpenSSH Agent

like image 158
Donal Avatar answered Sep 16 '22 13:09

Donal


I solved the problem by changing the StartupType of the ssh-agent to Manual via Set-Service ssh-agent -StartupType Manual.

Then I was able to start the service via Start-Service ssh-agent or just ssh-agent.exe.

like image 40
quervernetzt Avatar answered Sep 20 '22 13:09

quervernetzt