Establish SSH Connection between Local Git & GitHub

Posted by

Call it personal preference but I prefer to connect to GitHub via SSH instead of HTTPS.  If there are others out there that prefer this method I thought I would take the time to write a quick how to article on making an SSH connection from your local Git to your GitHub account.

Step by step process

$ ls -al ~/.ssh

Check to see if you already have an SSH key

$ ssh-keygen -t rsa -b 4096 -C “Username that appears in green”

Generates SSH key

$eval $(ssh-agent -s)

Confirm SSH agent is running

$ssh-add ~/.ssh/id_rsa

Add the ssh key to agent

Next we need to let github know about our key

Open id_rsa in notepad

Kee this handy

Go to github and go to your settings

New SSH keys

Finally we need to verify communication between local machine and github

$ ssh -T git@github.com

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

Allows you to connect via SSH

Summary:
As you can see it takes a little work flipping between Git and GitHub but the work pays off in the long run.  As always, I hope y’all found this helpful.

Leave a Reply