There are multiple posibilities
regarding the choice of key type.
Sunpyter assumes that your private ssh key is ~/.ssh/id_rsa
,
so this guide will focus on RSA keys.
Check if you have the files ~/.ssh/id_rsa
and ~/.ssh/id_rsa.pub
.
("~
" represents your home directory,
in the Bash jargon).
Only if these two files DO NOT exist,
generate a public-private key pair with
ssh-keygen -t rsa
Follow the instructions on screen, and remember the passphrase.
These are the expected steps:
- type
ssh-keygen -t rsa
and press enter. - You will get the output
If you do not have already a file called
Generating public/private rsa key pair. Enter file in which to save the key (/path/to/your/home/directory/.ssh/id_rsa):
~/.ssh/id_rsa
, you can just press enter here and use the default location displayed in brackets. - You will then get
Here you need to type a passphrase (not a simple password, it needs to be strong. You can use a full sentence, for example). You won't be able to see what you're typing.
Enter passphrase (empty for no passphrase):
- You will be prompted to type the same passphrase again:
You won't be able to see what you're typing.
Enter same passphrase again:
- If you haven't made any mistakes,
you should see something similar to
If so, then you've configured your ssh keys correctly.
Your identification has been saved in /path/to/your/home/directory/.ssh/id_rsa Your public key has been saved in /path/to/your/home/directory/.ssh/id_rsa.pub The key fingerprint is: SHA256:hKoeWtgMY/bYWkg7KcvJOWw5MJ87bzDAlZjY9swWHCs your-username@your-machine The key's randomart image is: +---[RSA 3072]----+ |..o.o. | |.oooo. . | |..E+... . | |.. .=. . | |o= .. S | |**X. | |=OBB | |+@X.. | |+*==. | +----[SHA256]-----+
After this step we will be able to connect to Sunbird without typing your password. This is extremely convenient because Sunpyter needs to connect to sunbird many times on your behalf. Without this step, you would be asked to type in your password many times in unexpected situations, and this is something that can lead to errors. To install the key on the remote machine (Sunbird in this case)
ssh-copy-id [email protected]
If you have already done that in the past, you will get a message telling you that the keys already exist on the remote system.
You can use the same key to deal with authentication on GitHub. You may need to type in your github password at some point, so keep it ready.
In order to do so,
- In your browser,
go to
https://github.com/settings/ssh/new
. - In your terminal,
print to screen
the content of
~/.ssh/id_rsa.pub
:Select the text that is displayed and copy it to your browser tab on the github website, in the Key text field.cat ~/.ssh/id_rsa.pub
- Click the green "Add SSH key" button.