0

I am using Windows 10 v20H2, with OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2. The ssh-agent service is running, but I cannot get ssh-add to do anything productive. I did initially add a key, which seemed to be accepted, but never worked. Now nothing in ssh-add seems to work.

> where.exe ssh-add
C:\Windows\System32\OpenSSH\ssh-add.exe

> ssh-add -v .\id_rsa
Enter passphrase for .\id_rsa:
Could not add identity ".\id_rsa": invalid format

> ssh-add -l
error fetching identities: invalid format

> ssh-add -D
Failed to remove all identities.

If I run in a different account in an elevated Powershell then it seems to work properly:

PS C:\> ssh-add -l
The agent has no identities.

I believe the key is OK because it works when I pass it directly to ssh using the -i parameter, but I've also tried many different key variations.

Note that this is on a work system which is quite locked down, so there may be some unexpected group policies in effect.

In desperation I deleted the single key I initally added directly from the registry (in SOFTWARE\OpenSSH\Agent\Keys), but the same error messages remain. I'm looking for suggestions as to what to try next.

1 Answer 1

0

After seeing suggestions for a similar problem at https://github.com/PowerShell/Win32-OpenSSH/issues/1454#issuecomment-533305642 I ran set at a command prompt to discover SSH_AUTH_SOCK was unexpectedly set. I also have Git Bash installed, so that ssh-agent was conflicting with the Windows one.

After deleting SSH_AUTH_SOCK and SSH_AGENT_PID from my environment variables everything is now working as expected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .