How to set SSH access to GitHub

server
2 min read

The steps that you need to set up SSH access to your GitHub account so that you can easily clone the projects over SSH on both the dev machine and the server.

This post tries to capture the steps that I need to set up SSH access to my GitHub account so that I can easily clone the projects over SSH on both my dev machine and the server.

Prerequisites:

  • Create a GitHub if you don't have one

5 easy steps to setup SSH access to GitHub

Create a new SSH key if not exists

ssh-keygen -t ed25519 -C "your@email.here"

View the public SSH key

cat ~/.ssh/<file_name_used_above>.pub

Copy the above contents of the public key to GitHub using below steps

open github
-> settings
-> SSH and GPG keys
-> new SSH key
-> give a name to identify the SSH source
-> paste the public key copied earlier
-> add SSH key
-> github will then verify your password to save the key

Test the SSH connection

ssh -T git@github.com

Now clone projects using SSH

git clone git@github.com:<git_username>/<repo_name>.git