Skip to content

Instantly share code, notes, and snippets.

@wildone
Last active November 14, 2020 03:05
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 wildone/8a7917ccfe7ae1b4fb34b88fe4969213 to your computer and use it in GitHub Desktop.
Save wildone/8a7917ccfe7ae1b4fb34b88fe4969213 to your computer and use it in GitHub Desktop.
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