Skip to content

How to add SSH key on Github and clone a repo with SSH key.

Notifications You must be signed in to change notification settings

arnabmunshi/clone-with-SSH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Add SSH key on github

Step #1

  • Open Bash Terminal
  • Reference
  • ssh-keygen -t rsa -b 4096 -C "<Your GitHub Email ID>"

Step #2

  • Enter file in which to save the key
  • Default is id_rsa or if you want change the type
  • /<DRIVE>/Users/<Username>/.ssh/<id_rsa_test>

Step #3

  • Enter passphrase

Step #4

  • Enter same passphrase again:

Step #5

  • Start the ssh-agent in the background
  • eval $(ssh-agent -s)

Step #6

  • Add your SSH private key to the ssh-agent.
  • ssh-add ~/.ssh/<id_rsa_test>

Step #7

  • Add SSH key to Github account
  • Reference
  • Copy the SSH key on clipboard
  • clip < ~/.ssh/<id_rsa_test.pub>

Step #8

  • Open this link on your browser
  • Link
  • Click "New SSH key" button
  • Give a Title Like:
  • And paste key on the key Textarea
  • Click "Add SSH key" button
  • Now your newly crated SSH key icon is "Gray"

Testing your SSH connection

ssh -T git@github.com

Clone GitHub Repo With SSH

  • Reference
  • Open your project directory
  • Open your bash terminal on same project directory
  • eval $(ssh-agent -s)
  • ssh-add ~/.ssh/<id_rsa_test>
  • git clone git@github.com:arnabmunshi/Clone-With-SSH.git
  • Now your newly crated SSH key icon turn into "Green"

Used git.io to short git url

About

How to add SSH key on Github and clone a repo with SSH key.

Topics

Resources

Stars

Watchers

Forks