Setup Git + Github With Ssh On Linux
Setup git + GitHub with ssh on Linux
Akbar S. Ahmed | Jan 5, 2014

Step-by-step instructions

Step-by-step instructions on how to setup git and GitHub with ssh authentication on Linux.

Install git

sudo apt-get install git

Set your git username

git config --global "your-github-username"

Set your email

git config --global "your-github-email-address"

Setup the password cache

We’ll setup our password to cache for 1 hour for repos that we access via https.

git config --global credential.helper cache

git config --global credential.helper 'cache --timeout=14400'

Create a new ssh key

ssh-keygen -t rsa -C "your-github-email-address"

Add your ssh key to GitHub

vi ~/.ssh/

Open a browser to and perform the following actions after logging in.

  • Click Account Settings.
  • Click SSH Keys in the left pane.
  • Click Add SSH key.
  • Enter the following in Title: Development SSH key.
  • Paste your key into Key.
  • Click Add key.

Verify that everything is setup correctly

ssh -p 22 -T

The output should look like:

The authenticity of host ' (' can't be established.
RSA key fingerprint is XX:XX:XX:XX:XX:XX:XX:XX.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ',' (RSA) to the list of known hosts.
Hi your-github-username! You've successfully authenticated, but GitHub does not provide shell access.

Subscribe to our newsletter

Contact Information


We specialize in helping professional developers, like you, expand your skill set. Our courses are focused on enabling you to learn everything necessary to use a new technology in a live, production application.


All courses are made with love in
Palo Alto, CA.

Subscribe to our newsletter