SSH Server Feature
PrimeHub provides a feature of SSH Server that users are allowed to access into their own launched Notebook via SSH. A practical use-case is that users are able to use IDEs such as VSCode which has remote-ssh extension for the development remotely. In other words, it provides other possible development options for users who like to use rich-features IDEs instead.
Enable SSH Server
To activate SSH Server, administrators have to configure SSH Server of PrimeHub. Please contact administrators and see Configure SSH Server.
Before using this feature, you are required to have a public/private key pair, please go to SSH key generation to generate your own pair at local.
Before starting a notebook, expand
Show advanced settings
and checkEnable SSH Server
.Hovering the cursor over the code block, copy the configuration by clicking the copy icon.
Press
Start Notebook
to launch the JupyterHub.Go back to your local, edit the
~/.ssh/config
with adding the copied configuration at your local. Make surejupyter-<username>
and~/.ssh/id_rsa
(private key) are correct according to your circumstance.
If you want to assign other private key, please change the path ~/.ssh/id_rsa
in the configuration to the desired one. If your key requires passphrase, you may want to add into ssh-agent.
Deploy Public key into JupyterHub
After Notebook is launched,
In Notebook page, it shows the same instruction for the reference
Drag-n-drop a public key (e.g.
id_rsa.pub
) from your local to theFile Browser
of the opened JupyterHub tab on browser.Open
Terminal
on Notebook, run the commandsGo back to your local, run the command for verification.
After SSH into the Notebook successfully, you should see the prompt:
Once the initial setup is completed, only step 1 is required for accessing Notebook via SSH.
Practical Usecase - VSCode
If you are familiar with VSCode, check our guide, VSCode + Remote-SSH.
Troubleshooting
If permission denied or connection refused occurs, please check our advices for troubleshooting.
Last updated