Could not open a connection to your authentication agent.
28 August 2007, early morning
SSH private-keys are usually stored encrypted on the computers they are stored on. A pass-phrase is used to decrypt them when they are to be used. Since most people use SSH public-private key-pairs to get around typing in passwords all the time, the ssh-agent daemon exists to store decrypted private-keys you plan on using in a given session. The thing most people get tripped up on when using ssh-agent is that what the program outputs, some borne or csh shell commands, needs to be run. It may look like ssh-agent has set some variables for you, but it has in fact done no such thing. If you call ssh-add without processing ssh-agent’s output, it will complain it is unable to open a connection to your authentication agent. The most straightforward way to run ssh-agent on the command line is as follows: eval `ssh-agent`. After doing this, calls to ssh-add should succeed without error.
Thank you for this tip, it saved my coffee-break time !
by Michaƫl on Sep 8, 11:52 #
You saved more than my coffee break! Thanks for the assistance!
by Stephen Mouring on Mar 15, 14:46 #
Hi,
I have the ssh-agent running but I still get the error message that it is unable to open a connection to the authentication agent when I call “ssh-add”. Any idea if I’m missing some other step?
Appreciate your help!
by AR on Apr 14, 13:52 #
Did you run it as specified above, by eval’ing the output? That’s really all you need to do. Otherwise just export the variables it spits out yourself.
by Ramanan on Apr 14, 13:57 #
Thank you!
by Justin on May 14, 14:01 #
Dear all,
I am a newbie on Linux and I am facing a similar problem.
I run eval ssh-agent on command line but I still can’t manage to open the connection. Is there something I am missing?
Thanks is advance.
by Sammie on May 29, 10:11 #
That’s really all you should need to do. You can manually export the variables ssh-agent spits out (copy and paste them all to the comand line), but basically, that’s what eval is doing.
by ramanan on May 30, 11:04 #
thanks a lot
by roby on Jul 7, 07:39 #
You can also do the following :
(dont forget to kill the old agent(s))
The punctuation is important.
This will read your agent setting into the shell :
. .agentinfoAnd now starting the agent will continue without a problem.
ssh-agentMake sure there is a space between the 2 dots. :/
by Leendert J.N. Schouten on Jul 29, 05:36 #
while executing ssh-add in windows xp command prompt it give “Could not open a connection to your authentication agent” could u pls help me to solve the problem
by ponmarimuthu.natesan on Feb 5, 02:59 #
Download putty and putty agent.
by ramanan on Feb 5, 10:52 #
Thanks A lot mate
by Faris Madi on Mar 15, 03:49 #
Had a problem: Could not open a connection to your authentication agent.
Second hit on the google.
Boooya here is the quick fix:
eval `ssh-agent`
You’re ace!
by Indrek on Apr 24, 04:46 #
Thanks .. was wondering why it was not working… saved my time
by Manoj on May 6, 23:14 #
Thanks for the post, was facing this issue myself.
This happens specially when I try to log in as one account on my laptop, and then su – some_other_user, from where I try to do ssh-add.
I was thinking if I have to run more ssh-agent etc, but the fix was much simpler.
Guess its safe to put the eval in .bashrc.
by John Laker on May 26, 21:39 #
Thanks :)
Saved my time!
by diogo on Jun 9, 10:26 #
Hi, i also have the same problem. i’ve done eval ‘same-agent’, still the same. “Could not open a connection to your authentication agent”. Any ideas what else i could do? Thanks
by Catherine on Aug 5, 08:21 #
I think you are using the wrong quote, it is not
', it’s`, which is the quote string above the tab key on most keyboards.by ramanan on Aug 5, 08:34 #
ssh-agent is running o.k.
eval `ssh-agent` also giving output but still not able to add key
any suggestion?
by shail on May 25, 20:12 #
Great!
by eugene on Jul 24, 18:56 #