1

I am attempting to add an ssh key using ssh-add. Upon running ssh-add ~/.ssh/insertkeynamehere I am prompted with:

Could not open a connection to your authentication agent.

After doing some research it would appear as if this is because my ssh-agent is not running but ps -ef | grep ssh-agent indicates otherwise:

cdm       1760  1727  0 14:35 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=classic-gnome

Even after running:

exec ssh-add bash

And seeing:

cdm       1760  1727  0 14:35 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=classic-gnome
cdm       2903     1  0 14:45 ?        00:00:00 ssh-agent

This problem still seems to persist. Any help would be much appreciated and if you need to see anymore console output let me know and I'll be happy to post.

*Note I am using Ubuntu 11.04

user380166
  • 13
  • 4

1 Answers1

2

Try:

$ `eval ssh-agent`

Which echo series of environment variables making ssh-add to work. Just paste that into your terminal and:

$ exec ssh-agent bash

Then:

$ ssh-add ~/.ssh/insertkeynamehere

source: Ubuntu manpages: ssh-add

Adrien P.
  • 789
  • 3
  • 9
  • Thanks for the suggestion, after running 'eval ssh-agent' I received: SSH_AUTH_SOCK=/tmp/ssh-fSYxVokg3559/agent.3559; export SSH_AUTH_SOCK; SSH_AGENT_PID=3560; export SSH_AGENT_PID; echo Agent pid 3560; After running the add again the same 'Could not open a connection to your authentication agent.' – user380166 Oct 27 '11 at 16:52
  • Then, try again the "exec ssh-agent bash" ? I have edited my Answer. – Adrien P. Oct 27 '11 at 16:55
  • Still no luck even with the exec ssh-agent bash. – user380166 Oct 27 '11 at 17:10
  • Strange, did you paste the output of 'eval ssh-agent' into your terminal before using ssh-add ? – Adrien P. Oct 27 '11 at 17:13
  • Oops, didn't paste in the output, it appears to be working now, thanks for your help. – user380166 Oct 27 '11 at 17:18