PrimeHub v3.0+ provides a new feature of SSH Server that users are allowed to access into their own launched JupyterHub 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.
JupyterHubfrom side-menu, before staring a notebook, expand
Show advanced settingsand check
Enable SSH Server.
Hovering the cursor over the code block, copy the configuration by clicking the copy icon.
Start Notebookto launch the JupyterHub.
Go back to your local, edit the
~/.ssh/configwith adding the copied configuration at your local. Make sure
~/.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_rsain 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 JupyterHub is launched,
In JupyterHub menu on User Portal, it shows the same instruction for the reference.
Drag-n-drop a public key (e.g.
id_rsa.pub) from your local to the
File Browserof the opened JupyterHub tab on browser.
Terminalon JupyterHub, run the commands
mkdir -p ~/.ssh mv ~/id_rsa.pub ~/.ssh/authorized_keys
Go back to your local, run the command for verification.
After SSH into the JupyterHub successfully, you should see the prompt:
Once the initial setup is completed, only step 1 is required for accessing JupyterHub via SSH.
Practical Usecase - VSCode
If you are familiar with VSCode, check our guide, VSCode + Remote-SSH.
If permission denied or connection refused occurs, please check our advices for troubleshooting.