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
.
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.
Settings
:SSH and GPG keys
:New SSH key
:ASPP
. Leave the Key type
to the default Authentication key
. Paste the public key you have saved in the system's clipboard into the Key
field on this page by pressing Ctrl-V
:Add SSH Key
green button right below.You can now verify that your key has been added on the same page https://github.com/settings/keys :
/run/media/student/ASPPXX
, where XX
is the number of your stickNUMBER=XX mv /tmp/id_$NAME* /run/media/student/ASPP$NUMBER/
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.