Video Course

Get to Know Git: Lesson 6 of 14

SSH Keys for Authentication

Up Next

Pushing Local to Remote

Autoplaying in 7 seconds!

Cancel

There are a couple ways we can authenticate with GitHub (or other servers for that matter). We can do the following:

  • username/password
  • SSH keys

While we could use username/password, it could get tedious entering in our password whenever we wanted to push/pull changes. SSH keys create a very secure connection and we won't have to bother with passwords anymore.

SSH keys consist of creating a pair of keys, one public and one private. We'll generate the pair and place our public key with GitHub. Our private key will stay on our computer. Then we can connect and push/pull/clone from our online repos.

To create an SSH key:

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

You can leave the passphrase blank or create one if you like. The command will also tell you where you can find your new SSH key pair in your file directories.

Chris Sevilleja

162 posts

Co-founder of Scotch.io. Slapping the keyboard until something good happens.