Vijay Kumar
Vijay Kumar

Reputation: 2717

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

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?

Upvotes: 58

Views: 36706

Answers (2)

Ricky Levi
Ricky Levi

Reputation: 8007

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

Upvotes: 20

Oliver
Oliver

Reputation: 13031

Start the ssh-agent by running

$ eval "$(ssh-agent)"

in your terminal window.

Upvotes: 105

Related Questions