From charlesreid1

Revision as of 07:18, 27 August 2015 by Admin (talk | contribs) (Created page with "SSH Keys To be able to clone projects from Github using SSH instead of HTTPS (which will also keep it from pestering you for your Github password every time you do something)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

SSH Keys

To be able to clone projects from Github using SSH instead of HTTPS (which will also keep it from pestering you for your Github password every time you do something), you first have to set up a public key with Github. This will allow your computer to SSH into Github's server without a password, and from there you can fetch Github projects.

To create a public key:

$ ssh-keygen -t rsa -b 4096 -C "your@email.com"

Now you'll be prompted with some questions, and your private and public key pairs will be generated and put into your ~/.ssh directory.

Now go to Github.com, and click your personal icon, and Manage Profile.

Now click SSH Public Keys on the left hand menu.

Add your new computer name. Now you'll copy and paste your public key from the terminal. You can dump it out with the command:

$ cat ~/.ssh/id_rsa.pub

That will print it to the screen, where you can copy and paste it into Github.

Test

To test that you can successfully access Github's server without a password, execute the command:

$ ssh -T git@github.com

from the command line. You should see a message that indicates you can successfully connect to Github's servers.

Use

Now we can clone projects using the SSH repository address, git clone git@github.com:username/projectname, instead of the HTTPS address.