GitHub account setup

Author

Marie-Hélène Burle

Create a free GitHub account

If you don’t already have one, go to the GitHub website and create a free account.

Connect to GitHub

There are 2 ways to use GitHub:

  • using a token,
  • using SSH.

Using a token

A token can be generated directly within GitHub settings, which seems convenient. However, if you use a token, you will have to communicate with GitHub via HTTPS and enter your token whenever you push and pull to your GitHub directories. It is quite tedious.

Using SSH

To use SSH, you first need to generate an SSH key pair, then add the public key to your GitHub account.

SSH agent

An SSH key pair is a set of 2 files: the private key and the public key. You keep the private key securely on your machine—think of it as a key to open a lock—and you upload the public key to GitHub (or other places such as the Alliance clusters)—think of that as a lock.

Your private key allows to “open the lock” if it matches the public key.

People can see your public key, but they can’t generate the private key from it. Since you are the only one having the matching private key, you are the only one able to open that lock and log in securely …

… unless someone steals your private key (if they steal your laptop or it gets compromised).

To add a level of safety, you can set a passphrase when you generate an SSH key pair. Now, to open that lock (public key), not only you need to have the matching private key, but you also need to enter the passphrase.

But that means that you will have to enter your passphrase each time you push and pull to GitHub, which is not much more convenient than using tokens!

The trick here is to use an SSH agent to cache your passphrase and not have to type it each time.

Linux and macOS

Windows