From charlesreid1

(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)...")
 
No edit summary
Line 1: Line 1:
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.
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:
To create a public key:
Line 10: Line 12:


Now you'll be prompted with some questions, and your private and public key pairs will be generated and put into your <code>~/.ssh</code> directory.
Now you'll be prompted with some questions, and your private and public key pairs will be generated and put into your <code>~/.ssh</code> directory.
==Add Public Key==


Now go to Github.com, and click your personal icon, and Manage Profile.  
Now go to Github.com, and click your personal icon, and Manage Profile.  
Line 15: Line 19:
Now click SSH Public Keys on the left hand menu.
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:
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:


<pre>
<pre>
Line 23: Line 31:
That will print it to the screen, where you can copy and paste it into Github.
That will print it to the screen, where you can copy and paste it into Github.


==Test==
==Test Public Key==


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

Revision as of 07:19, 27 August 2015

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.