Skip to content

Instantly share code, notes, and snippets.

@gubatron
Last active November 28, 2018 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gubatron/e2a3841f37342a0f837aae6f16a6ecda to your computer and use it in GitHub Desktop.
Save gubatron/e2a3841f37342a0f837aae6f16a6ecda to your computer and use it in GitHub Desktop.
quick and dirty startSSHAgent bash function
function startSSHAgent {
if [[ -z "$SSH_AGENT_PID" ]]; then
echo "Starting fresh ssh agent"
else
kill $SSH_AGENT_PID
fi
eval `ssh-agent`
ssh-add ~/.ssh/my_private_key
ssh-add ~/.ssh/my_private_key_2
...
ssh-add ~/.ssh/my_private_key_n
}
startSSHAgent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment