Skip to content

Instantly share code, notes, and snippets.

@kjhosein
Created February 12, 2025 18:09
Show Gist options
  • Save kjhosein/f7b2a603ead888906d97e689281872d9 to your computer and use it in GitHub Desktop.
Save kjhosein/f7b2a603ead888906d97e689281872d9 to your computer and use it in GitHub Desktop.
Shell script to run ssh-agent and add the GitHub SSH key
# *nix shell script to add the GitHub key to my environment
# This must be sourced when run (i.e., $ source ./load_github_key.sh or $ . ./load_github_key.sh)
eval "$(ssh-agent -s)"
ssh-add -v ~/.ssh/name_of_your_github_private_ssh_key
ssh-add -l
# test key
echo
ssh -T [email protected]
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment