How to use Github with SSH

Written on 01 July 2015

First stage to learn how to use git, after a year just clone.

New to git , read this: Git reading list for beginner

Set up git

Generating SSH keys

ssh-keygen -t rsa -b 4096 -C "[email protected]"
Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Type ~/.ssh/git_id_rsa Press enter]  
Enter passphrase (empty for no passphrase): [Press enter]  
# Enter same passphrase again: [Press enter]


Config Git

Edit ~/.ssh/config



     User git

     Port  22

     IdentityFile ~/.ssh/git_id_rsa
     Compression yes

Go to Github setting to add public key.

Use cat ~/.ssh/ to get public key.

Test configuration

ssh -T [email protected]  
Hi username! You've successfully authenticated, but GitHub does not provide shell access.  


Read more on git Github