Git Bash:ssh-Add Could Not Open A Connection To Your Authentication Agent

460    Asked by AlGerman in Data Science , Asked on Nov 18, 2022

I'm new to Github and Generating SSH Keys look a necessity. I successfully created SSH Key but when I'm going to add it to the ssh-agent

ssh-add ~/.ssh/id_rsa.pub

Could not open a connection to your authentication agent.

Answered by Amit raj

Could not open a connection to your authentication agent

To resolve this error:
bash:
$ eval `ssh-agent -s`
tcsh:
$ eval `ssh-agent -c`
Then use ssh-add as you normally would.
Hot Tip:

I was always forgetting what to type for the above ssh-agent commands, so I created an alias in my .bashrc file like this:

alias ssh-agent-cyg='eval `ssh-agent -s`'
Now instead of using ssh-agent, I can use ssh-agent-cyg
E.g.
$ ssh-agent-cyg
SSH_AUTH_SOCK=/tmp/ssh-n16KsxjuTMiM/agent.32394; export SSH_AUTH_SOCK;
SSH_AGENT_PID=32395; export SSH_AGENT_PID;
echo Agent pid 32395;
$ ssh-add ~/.ssh/my_pkOriginal Source of fix:

http://cygwin.com/ml/cygwin/2011-10/msg00313.html



Your Answer

Interviews

Parent Categories