Skip to content

Instantly share code, notes, and snippets.

@h2xd
Created May 13, 2020 20:10
Show Gist options
  • Save h2xd/af2b5fc274627d578d4f1b897ef54eb1 to your computer and use it in GitHub Desktop.
Save h2xd/af2b5fc274627d578d4f1b897ef54eb1 to your computer and use it in GitHub Desktop.
Windows .bashrc to autostart the ssh agent and add your ssh-keys automatically
if [[ "$SSH_AUTH_SOCK" = "" ]]; then
# first round add the ssh agent
exec ssh-agent bash
else
# here you can add your ssh keys
# github as an example
ssh-add ~/.ssh/github_com_rsa
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment