Connect to GitHub using SSH keys

Connect to GitHub using SSH keys

As of August 2021, GitHub has removed support for Password Authentication while using HTTPS protocol.  It is convenient (and recommended) to access GitHub repos securely using SSH Keys.

Generate a public/private RSA key pair

Skip to next step if you already have an existing SSH key pair
Windows 10/11 - Use Powershell/Windows Terminal or WSL

$ ssh-keygen

 The output of the command should look as follows:



Access the Key Pair

Once this command has completed you can display your SSH key pairs in your home directory ($HOME/.ssh/).
cat ~/.ssh/id_rsa.pub
The output of the 'cat' command will display the file contents:

You need to upload the contents of this Public key file to your GitHub profile.

Upload your public key to GitHub

Go to your GitHub profile and click on 'Settings':



Select the Access option for 'SSH and GPG keys'



Select 'New SSH key'

Add a title for this key, and paste the contents of the public key file (~/.ssh/id_rsa.pub) into the Key textarea:


Access the SSH based GitHub URL

Once the settings are saved you can use SSH based GitHub URLs to access your private repos.