SourceTree + OpenSSH error: Could not open a connection to your authentication agent

831 Views Asked by At

I've been trying to add a private key for a while now using SourceTree and OpenSSH. I have tried all the solutions and derivations proposed in this answer to no avail. I've tried all variations of

eval `ssh-agent -s`
ssh-add

that I've found. I disabled all firewalls, antivirus, and even tried it in netorked safe mode. The first command runs fine, and the agent gets a pid, but the ssh-add command throws the error in the title every time. I've also used different names for the .pem file, including the original name and location, username/.ssh/id_rsa.pem (some people had had problems due to the file name), etc., but nothing changes.

I can connect manually to the repository by using the command

ssh -i /route/to/key/key_name.pem ubuntu@serverip

but I want to be able to use it to push changes to the repo through Git. I'm really stumped on this one, and I'm by no means an expert. Can anyone think of another reason for this?

1

There are 1 best solutions below

0
On BEST ANSWER

In the end I had to give up on using OpenSSH for Windows. I installed PuTTY, transformed the .pem key into a .ppk with PuTTYgen, and added the private key with SourceTree without trouble.