ssh-add "Error connecting to agent: Connection refused"

Viewed 21610

My MacBook rebooted and when it does that I have to typically add my private key via ssh-add, using the following command

$ssh-add ~/.ssh/id_rsa

And I never have any issues, Today I am getting this error

ssh-add ~/.ssh/id_rsa
Error connecting to agent: Connection refused

What may be causing this? How do I fix it?

2 Answers

Start the ssh-agent by running

$ eval "$(ssh-agent)"

in your terminal window.

I'm using iTerm2 on mac, I just Session -> Restart session

Related