Github: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
Official page here: https://help.github.com/articles/generating-ssh-keys/ | |||
=SSH Keys= | =SSH Keys= | ||
Revision as of 07:20, 27 August 2015
Official page here: https://help.github.com/articles/generating-ssh-keys/
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.
Create Public Key
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.
Add Public Key
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.
Copy-Paste Public Key
You can dump out your public key 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 Public Key
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.