Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've been trying to get ssh-add working on a RaspberryPi running Raspbian.

I can start ssh-agent, when I do it gives the following output into the terminal:

SSH_AUTH_SOCK=/tmp/ssh-06TcpPflMg58/agent.2806; export SSH_AUTH_SOCK;
SSH_AGENT_PID=2807; export SSH_AGENT_PID;
echo Agent pid 2807;

If I run ps aux | grep ssh I can see it is running.

Then I try to run ssh-add in order to add my key passphrase, and I get the following:

Could not open a connection to your authentication agent.

Any ideas?

share|improve this question
3  
Try eval $(ssh-agent) – Ulrich Dangel Sep 22 '12 at 15:28

1 Answer

up vote 20 down vote accepted

Your shell is meant to evaluate that shell code output by ssh-agent. Run this instead:

eval "$(ssh-agent)"

Or if you've started ssh-agent already, copy paste it to your shell prompt (assuming you're running a Bourne-like shell).

ssh commands need to know how to talk to the ssh-agent, they know that from the SSH_AUTH_SOCK environment variable.

share|improve this answer
Thanks, I didn't quite understand how it works. Thats very muchly appreciated. – Daniel Groves Sep 22 '12 at 17:30
Or you can enter ssh-agent bash and after the ssh-add will work – RaduM May 15 at 13:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.