GitHub SSH Authentication
These optional one-time steps will guide you through configuring SSH authentication to github.com, which is more secure than passing credentials each time when using HTTPS. But if you prefer to clone the repository via HTTPS, you can skip this page and proceed to Clone the Git repository.
NOTE: On Windows, the instructions found here will work best when using the Git Bash shell that is installed with Git for Windows. If you have not already installed that, go do it now and then return here.
Open a Git Bash terminal command prompt.
Determine whether you already have a certificate you can use:
ls -al ~/.ssh
Look for id_ed25519.pub (preferred) or id_rsa.pub (also supported). If you already have a key, you can move on to the "Copy the content" step below.
Create an ed25519 certificate and add it to your local SSH agent:
ssh-keygen -t ed25519 -C "your@email.com"
ssh-add ~/.ssh/id_ed25519
If ed25519 is not supported, create an RSA certificate and add it to your local SSH agent:
ssh-keygen -t rsa -b 4096 -C "steve.ives@synergex.com"
ssh-add ~/.ssh/id\_rsa
Copy the contents of your certificate's PUBLIC KEY (the file with the .pub extension) to the clipboard. Display this content using one of these commands:
cat ~/.ssh/id\_ed25519.pub
cat ~/.ssh/id\_rsa.pub
IMPORTANT: Never share the file content without the .pub extension. These are your PRIVATE keys and disclosing them will compromise your security.
Go to the SSH Keys section of your GitHub profile (if you are logged in to GitHub, you can get there directly by going to https://github.com/settings/keys) and then click the New SSH key button, enter a name for your key that identifies the system it's from, paste your public key data into the Key field, and click the Add SSH key button at the bottom of the page.
Back in the Git Bash window, you can test the SSH access:
ssh -T git@github.com
You should see a message similar to this:
Hi Your Name You've successfully authenticated, but GitHub does not provide shell access.
Having completed this process you can now clone repositories using the SSH mechanism instead of the HTTPS mechanism.