Setting up SSH key for code repository access

All of our code for OCPI is hosted on github.com. Because of UCSB's enterprise contract with Github, we use the "ocpi" team within the "ucsb" organization. The required Single-Sign-On authentification makes us to an extra step: setting up an SSH key for your computer. This guide explains how to do this for Linux, Mac, and Windows.

We only need to do this once for every computer. Carefully follow these steps:

  1. Go to your Github profile icon and select Settings.

  2. Select SSH and GPG keys.

  3. Click New SSH key.

  4. For Title, enter the name of your computer, such as andrei_macbook_air. Something specific to your computer.

  5. For the Key, now that's the hard part - generating the SSH key. We'll do it once and that's it. Here's how.

6a. On Windows:

  • Open Git Bash and type ssh-keygen -t rsa
  • Press enter when it says Enter file...
  • No need for passphrase, press enter. Press enter again when prompted.
  • Type cat ~/.ssh/id_rsa.pub
  • Copy the output and paste in the Github "Key" box. Click Add SSH key.

6b. On Mac/Linux:

  • Open Terminal and type ssh-keygen -t rsa -b 4096 -C "aisichenko@ucsb.edu" using your email.
  • Press enter when it says Enter file...
  • No need for passphrase, press enter. Press enter again when prompted.
  • Type pbcopy < ~/.ssh/id_rsa.pub which will automatically copy the key. Paste it in the Github "Key" box. Click to Add SSH key.
  1. Under Enable SSO, below your should see a button that says "Authorize" for the ucsb organization, click this. That's it.

To clone any repository in ucsb organization (and therefore in the ocpi team), type:  git clone git@github.com:ucsb/tutorial_series.git