I know that the use of Git and SSH has been asked many times and answered, however, here is my problem.
I have the dreaded 'Could not open a connection to your authentication agent'. I understand how the ssh-agent works and it uses a socket file to communicate. If you do not specify the file ssh-agent uses /tmp/ssh-xxxxxxx/agent.pid as the default. With Windows 8.1 you can not create files in the main drive so Windows will put a redirect into C:\Users\userid\AppData\Local\Temp and put the file there. These are bieng created.
When I call eval $(ssh-agent) within Bash the agent is started as a separate process. I create the appropriate environment variables (SSH_AUTH_SOCK, SSH_AGENT_PID) in my Git Bash environment. When I call ssh-add it fails.
To test my understanding I have used a file within my User Directory by calling ssh-agent -a 'c:/Users/userid/Temp/socket' and set the environment variables correctly. Again it fails.
I then started the agent in debug mode ssh-agent -da 'c:/Users/userid/Temp/socket' which did not fork a process as expected. I then went to a Windows cmd prompt and set the environment variables. I then entered ssh-add, it worked, I was asked for the pass phrase for my private key.
My question is: Does anyone know why the background process is not picking up the ssh-add?
A few things have come to mind:
The background process is using a different user id and thus can not have access to the socket file.
The background process is not getting it environment variables set correctly.
I believe this is a Windows problem rather than an ssh one.
Any thoughts?