-
Install Git
-
sudo apt-get install git git-core
-
Configure Git
-
$ git config --global user.name "chuhe"
-
$ git config --global user.email [email protected]
-
-
Generate a key
-
$ ssh-keygen -t rsa -C "[email protected]" // same email as above
-
vim /home/linx/.ssh/id_rsa.pub // copy the key inside, or use cat directly
-
-
Open your GitHub page → click your avatar → settings → SSH KEYS → add SSH key → paste the copied content into key (choose any title) → save.
-
The important part
-
Test: $ ssh [email protected]
-
Successful output: chuhe@ubuntu:~$ ssh -T [email protected] Hi chuhemiao! You've successfully authenticated, but GitHub does not provide shell access.
-
If you keep pressing Enter and reach a yes/no prompt, remember to type yes, not y!
-
-
I struggled with the last step for more than a day, then happened to see a blogger say to type yes. Painful!