Connect to GitHub with Git on CentOS

  1. Install Git

    • sudo apt-get install git git-core

    • Configure Git

    • $ git config --global user.name "chuhe"

    • $ git config --global user.email [email protected]

  2. 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

  3. Open your GitHub page → click your avatar → settings → SSH KEYS → add SSH key → paste the copied content into key (choose any title) → save.

  4. 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!

  5. I struggled with the last step for more than a day, then happened to see a blogger say to type yes. Painful!

Stay updated

Get weekly research updates, market signals, and listing intelligence — follow along on Telegram or X.