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.

What's your current thoughts on this?

Best Answer


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.