Get to Know Git: Lesson 6 of 14

SSH Keys for Authentication

Up Next

Pushing Local to Remote

Autoplaying in 7 seconds!


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.

Table of Contents

    To create an SSH key:

    ssh-keygen -t rsa -b 4096 -C ""

    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

    176 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.