Skip to content

Instantly share code, notes, and snippets.

@median-man
Last active August 27, 2020 13:34
Show Gist options
  • Save median-man/78d28eee82323eec323f18807e40d33d to your computer and use it in GitHub Desktop.
Save median-man/78d28eee82323eec323f18807e40d33d to your computer and use it in GitHub Desktop.
Setting up SSH for Git VC

See https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Generate a new ssh key: ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Ensure agent is running: eval $(ssh-agent -s)

Add key to ssh agent: ssh-add ~/.ssh/id_rsa

Copy key to clipboard on windows: clip < ~/.ssh/id_rsa.pub

Copy key to clipboard on mac: pbcopy < ~/.ssh/id_rsa.pub

Add the key to GitHub and other platforms as needed.

Add GitHub to list of SSH hosts: ssh –T git@github.com

Other Git servers: ssh -T git@example.domain.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment