You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't add keys to ssh-agent, communication with agent failed #1234
Installed in c:\Windows\System32\OpenSSH in the 1803 Windows update.
Client OperatingSystem
Windows 10 Pro 1803
What is failing
ssh-add can't add keys to the ssh-agent.
Expected output
The keys are accepted and listed when ssh-add -l is run.
Actual output
ssh-add ..ssh\secret.pem
Could not add identity "..ssh\secret.pem": communication with agent failed
ssh-add -l
error fetching identities: communication with agent failed
output from ssh-agent.log:
4688 2018-08-16 15:19:37.613 error: LookupAccountNameW on SSHD account failed with 1789
4688 2018-08-16 15:19:37.615 fatal: failed to retrieve client details
13372 2018-08-16 15:32:40.157 error: LookupAccountNameW on SSHD account failed with 1789
13372 2018-08-16 15:32:40.157 fatal: failed to retrieve client details
972 2018-08-16 15:42:25.752 error: LookupAccountNameW on SSHD account failed with 1789
972 2018-08-16 15:42:25.752 fatal: failed to retrieve client details
9088 2018-08-16 15:47:46.669 error: LookupAccountNameW on SSHD account failed with 1789
9088 2018-08-16 15:47:46.672 fatal: failed to retrieve client details
There doesn't seem to be an sshd.exe in C:\Windows\System32\OpenSSH. I think I'm just missing a setting somewhere because I've gotten this working on other Windows machines of the same version with no issue.
I am using posh-git so I tried deleting the environment variables SSH_AGENT_PID and SSH_AUTH_SOCK but they don't exist. I'm guessing I'm using a newer version of posh-git?
Not loading posh-git doesn't seem to help either and the ssh-agent service starts fine.
Reacted by Rasmus Bækgaard, shrutivardhan1411 and Aljoscha Grebe
That check in ssh-agent can be removed as sshd now runs as SYSTEM. We'll fix it.
As a workaround to unblock you, could you create/install a dummy sshd service like this: sc.exe create sshd binPath=C:\Windows\System32\OpenSSH\ssh.exe
Reacted by Jim G, Dave Churchill, Chris, atmdev.net, Nathan Wilkinson, Joel Rowley, Stefan Hausotte, Harley Day, CJ Davis, Kijana Woodard and 59 more
That check in ssh-agent can be removed as sshd now runs as SYSTEM. We'll fix it.
As a workaround to unblock you, could you create/install a dummy sshd service like this: sc.exe create sshd binPath=C:\Windows\System32\OpenSSH\ssh.exe
Sorry to reanimate a dead thread, but just wanted to chime in that this solution works even for this failure in Oct 2019, thank you very much!
Reacted by Mark Coggeshall, Amit Chaurasia, Florian, Roman Ovchinnikov, Lindsay Wells, Maksim Mekh, CodeEpsilon-5, Hiroaki Nakamura, TobiRoby, Igor Skomorokh and 9 more
Reacted by Roman Ovchinnikov, Maksim Mekh and TiloGit
Manoj Ampalam (@manojampalam) are you able to give an indication as to when this might ship? This ticket is closed but the need to create a dummy sshd service is still present even in Insiders builds.
ssh-agent was disabled, and even after enabling refused to work until I created the dummy sshd service, on upgrade to 19569.1000.
Reacted by Lukas Schätzle, Dave Cluderay, Karol Zadora, nginhui, Charlie, TobiRoby, Markus Bartels, patpwilly, Guillaume Xavier Taillon, Raul Tambre and 2 more
Still relevant sadly and yes the workaround above does work, cs.exe wrapper. Feels like this should have been a pretty high priority awhile ago, but at least there's indication that the fix is coming.
Windows 10 20H2 build 19042.746.
Last friday my SSH Agent worked like a charm.
Today, I had to install OpenSSH Server to get rid of the error fetching identities: communication with agent failed
That check in ssh-agent can be removed as sshd now runs as SYSTEM. We'll fix it.
As a workaround to unblock you, could you create/install a dummy sshd service like this: sc.exe create sshd binPath=C:\Windows\System32\OpenSSH\ssh.exe
I had to run powershell as administrator to run this, but then I could ssh-add in any other powershell terminal.
winver 20H2
Applied fix and Github is working now, but getting error in BASH cmd now:
$ git pull
CreateProcessW failed error:193
ssh_askpass: posix_spawn: Unknown error
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
That check in ssh-agent can be removed as sshd now runs as SYSTEM. We'll fix it.
As a workaround to unblock you, could you create/install a dummy sshd service like this: sc.exe create sshd binPath=C:\Windows\System32\OpenSSH\ssh.exe
HAY I know this is old, hope you are still around. When I tried using the work around with my local user path I got the error:
Sorry to revive this thread; but the workaround unfortunately did not work for me, despite running in admin priv...
It only told me the service already exists, and ssh-add -l still no worky.
Activity
manojampalam commentedon Aug 17, 2018
see if this helps: #1133
draftsteve commentedon Aug 17, 2018
I read through this issue.
I am using posh-git so I tried deleting the environment variables SSH_AGENT_PID and SSH_AUTH_SOCK but they don't exist. I'm guessing I'm using a newer version of posh-git?
Not loading posh-git doesn't seem to help either and the ssh-agent service starts fine.
manojampalam commentedon Aug 17, 2018
That check in ssh-agent can be removed as sshd now runs as SYSTEM. We'll fix it.
As a workaround to unblock you, could you create/install a dummy sshd service like this:
sc.exe create sshd binPath=C:\Windows\System32\OpenSSH\ssh.exedraftsteve commentedon Aug 20, 2018
I created the dummy sshd service as described.
ssh-add now works as expected. Thank you Manoj Ampalam (@manojampalam)! This was driving me crazy.
Fixes to ssh-agent issues
ajrock commentedon Oct 3, 2019
Sorry to reanimate a dead thread, but just wanted to chime in that this solution works even for this failure in Oct 2019, thank you very much!
LukeCarrier commentedon Feb 24, 2020
Manoj Ampalam (@manojampalam) are you able to give an indication as to when this might ship? This ticket is closed but the need to create a dummy
sshdservice is still present even in Insiders builds.ssh-agentwas disabled, and even after enabling refused to work until I created the dummysshdservice, on upgrade to 19569.1000.ISkomorokh commentedon Jun 30, 2020
The workaround is still relevant in July 2020!
bagajjal commentedon Jun 30, 2020
Igor Skomorokh (@ISkomorokh) - The fix be part of next windows release which is available in fall timeframe this year.
4 remaining items
thomassuckow commentedon Nov 13, 2020
You can also just install the OpenSSH server windows feature to mitigate this issue even if you never start the openssh server service.
rbreaves commentedon Nov 24, 2020
Still relevant sadly and yes the workaround above does work, cs.exe wrapper. Feels like this should have been a pretty high priority awhile ago, but at least there's indication that the fix is coming.
moaxcp commentedon Jan 13, 2021
Just ran into this and the workaround fixed it. Thanks!
cconrad commentedon Feb 5, 2021
Still a good workaround in February 2021. Thank you
valentinovamsi commentedon Feb 9, 2021
worked like a charm, thank you :)
ferdinandosimonetti commentedon Feb 15, 2021
Windows 10 20H2 build 19042.746.
Last friday my SSH Agent worked like a charm.
Today, I had to install OpenSSH Server to get rid of the
error fetching identities: communication with agent faileddsisnero commentedon Feb 22, 2021
Still needed workaround
yangruan commentedon Mar 3, 2021
I had to run powershell as administrator to run this, but then I could ssh-add in any other powershell terminal.
wcarson commentedon Mar 3, 2021
March 2021...workaround still needed and still works
cima commentedon Mar 17, 2021
ssh-add used to work until last week, this week it needs the workaround. This issue needs to be reopened.
LeszekKalibrate commentedon Apr 22, 2021
winver 20H2
Applied fix and Github is working now, but getting error in BASH cmd now:
jbanks9 commentedon Nov 8, 2021
HAY I know this is old, hope you are still around. When I tried using the work around with my local user path I got the error:
[SC] OpenSCManager FAILED 5: Access is denied.
Do you know how I am able to fix this error?
Spaxe commentedon Nov 25, 2021
Hi Nia Newton (@jbanks9) you need to run PowerShell with Administrator privileges. It worked for me just now.
SlinkySlonkyOlivia commentedon Jan 22, 2023
Sorry to revive this thread; but the workaround unfortunately did not work for me, despite running in admin priv...
It only told me the service already exists, and ssh-add -l still no worky.
Fixes to ssh-agent issues