10

How do I turn the SSH Agent off? I'm having troubles with Vagrant and it indicates that I should disable my SSH Agent before continuing, yet I can't find a straight forward answer. How would I do it?

Temporary answers work too. I'm happy with how my environment is setup, it's just this particular situation where I need to verify that disabling the SSH Agent corrects the issue, even if I then turn it back on.

Jakuje
  • 1,588
  • 10
  • 21

3 Answers3

10

unset the environment variable $SSH_AUTH_SOCK. In bash, from where you run the vagrant commands, simply:

export SSH_AUTH_SOCK=""
Jakuje
  • 1,588
  • 10
  • 21
4
launchctl stop com.openssh.ssh-agent
4

eval $(ssh-agent -k) kills the agent in the current terminal.

It runs these commands

unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid 89141 killed;
Breedly
  • 233