Skip to content

Instantly share code, notes, and snippets.

@rh917
Created August 24, 2020 16:45
Show Gist options
  • Save rh917/3478fa939c1c28c9206e94ffffef5802 to your computer and use it in GitHub Desktop.
Save rh917/3478fa939c1c28c9206e94ffffef5802 to your computer and use it in GitHub Desktop.
ssh-add &>/dev/null || eval `ssh-agent` &>/dev/null # start ssh-agent if not present
[ $? -eq 0 ] && { # ssh-agent has started
ssh-add ~/.ssh/id_rsa &>/dev/null # Default identity
ssh-add ~/.ssh/<user-key> &>/dev/null # user-key
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment