GitHub Setup

1. Create a SSH Key-Pair

Open a terminal and start the interactive generation of a new SSH key-pair. Set your name (one single string without blanks) instead of alice in the following:

NAME=alice
ssh-keygen -f /tmp/id_$NAME

The program ssh-keygen will ask for a passphrase twice. Type a passphrase of your choice and remember it: you will have to type it quite often during the school. IMPORTANT: Do not leave the passphrase empty! If the generation is successful, you will see something like this:

ssh-keygen -f /tmp/id_alice
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /tmp/id_alice
Your public key has been saved in /tmp/id_alice.pub
The key fingerprint is:
SHA256:RJz6ek6B7z4QbUAYT0E1lbdVftsrA1khs/KUEUGxu5A student@aspp
The key’s randomart image is:
+---[RSA 3072]----+
|    .==++ooX+. ..|
|    .o..o.. O o. |
|      .+.. * +  o|
|      ooo = =   +|
|      .+SE =   ..|
|      ..... o   .|
|       oo  . o . |
|      .oo     o  |
|       ++.       |
+----[SHA256]-----+

This will have generated two files, one for the private key /tmp/id_alice and one for the public key /tmp/id_alice.pub.

2. Save the Public Key into the System’s clipboard

While still in the terminal, let save the public key into the system's clipboard so that we can re-use it later on GitHub. Type the following, of course using your own name and do not forget the .pub extension:

xclip -selection c /tmp/id_$NAME.pub

The contents of that file are now in the clipboard.

3. Upload the Public Key to your GitHub account

You can now verify that your key has been added on the same page https://github.com/settings/keys :

4. Store the SSH Key-Pair on the USB-Stick

NUMBER=XX
mv /tmp/id_$NAME* /run/media/student/ASPP$NUMBER/

5. Verify GitHub Authentication with SSH-key

ssh -T git@github.com

If after that you get something along these lines:

Hi Alice! You've successfully authenticated, but GitHub does not provide shell access

everything went well. If you instead get something like:

git@github.com: Permission denied (publickey)

something went wrong.