How to connect GitHub from Linux using private key

  1. Login to ternimal 
  2. Create ssh public key using the following command 
    ssh-keygen -t rsa -b 4096 -C ""
    Will ask for id.rsa file number. jus hit enter.
    Next will ask for passphrase, If you need to secure you git repository provide a phrase. Otherwise just hit enter. (remember it, will ask every time when you try to commit and push the code)
  3. ~/.ssh/ file is created in your user home directory.
  4. using vi ~/.ssh/ or gedit ~/.ssh/ edit it and copy the content of the file.
  5. Login in to
  6. Select your repository => "Settings" in top menu.=> Click "Deploy keys"
  7. Input "Title" for your reference, paste the copied key in to "Key" textarea.
  8. It will ask you to confirm you account password.
    Now your are ready to connect to you repository.
  9. Now create a folder and using "git clone" command.

During git push it will ask for passphrase, If you provided during the private key generation.(@Step 2)

Tags: Linux, GitHub, SSH Private Key, GIT