Created
August 3, 2017 22:37
-
-
Save dimadesu/67a26e8fb452dd62ab3dc43938cfe86c to your computer and use it in GitHub Desktop.
Start SSH-agent (for Git) on shell start and share the same connection for new instances. (Copy-pasted somewhere, works like a charm)
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
| # | |
| # This should only prompt for a password the first time you login after each reboot. It will keep reusing the ssh-agent as long as it stays running. | |
| # | |
| if [ ! -S ~/.ssh/ssh_auth_sock ]; then | |
| eval `ssh-agent` | |
| ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock | |
| fi | |
| export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock | |
| ssh-add -l | grep "The agent has no identities" && ssh-add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment