Last active
November 14, 2020 03:05
-
-
Save wildone/8a7917ccfe7ae1b4fb34b88fe4969213 to your computer and use it in GitHub Desktop.
Add ssh-agent to your bash start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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