Skip to content

Instantly share code, notes, and snippets.

@srkiNZ84
Created September 10, 2015 03:56
Show Gist options
  • Save srkiNZ84/e391b73491e0694f124e to your computer and use it in GitHub Desktop.
Save srkiNZ84/e391b73491e0694f124e to your computer and use it in GitHub Desktop.
Add SSH key to agent on bash startup
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0
fi
/usr/bin/ssh-add ~/some_private_key.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment