Skip to content

Instantly share code, notes, and snippets.

@jbonney
Created February 4, 2014 13:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbonney/8803777 to your computer and use it in GitHub Desktop.
Save jbonney/8803777 to your computer and use it in GitHub Desktop.
Run ssh-agent when you login, and kill it when you logout. Add code to ~/.bash_profile. Taken from http://blog.xk72.com/post/75565726956/ssh-agent
eval `/usr/bin/ssh-agent -s`
trap "kill $SSH_AGENT_PID" 0
@BluntlyCat
Copy link

Thanks! Even eight years later such a comment can be helpful! I was looking for the trap part :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment