Skip to content

Instantly share code, notes, and snippets.

@wildone
Last active November 14, 2020 03:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Add ssh-agent to your bash start
Best way to use ssh keys is to add them to SSH Agent, this will will allow you use ssh without needing to specify pasword for your SSH key all the time.
To do this add these lines to you `.bash_profile` or `.profile`
```bash
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
ssh-add ~/.ssh/id_rsa
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment