From d4f5edd4301d45964a8b69113dee841463ecbb9f Mon Sep 17 00:00:00 2001 From: Amelia Holcomb Date: Tue, 2 Jun 2026 12:55:26 -0400 Subject: [PATCH 1/2] Add details on using ssh keys Add missing steps to the ssh instructions: - An ssh key needs to be generated locally and added to github before adding it to authorized_keys on the hub - The local ssh config needs IdentityFile pointing to the private key on the local machine --- user-guide/scientific-computing/ssh.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/user-guide/scientific-computing/ssh.md b/user-guide/scientific-computing/ssh.md index 194e5516..42a3aa81 100644 --- a/user-guide/scientific-computing/ssh.md +++ b/user-guide/scientific-computing/ssh.md @@ -27,20 +27,33 @@ We are exploring two options for using VS Code on the VEDA JupyterHub. These opt Treat this token like you would treat a password to your JupyterHub instance! ::: -### Setup your local `~/.ssh/config` +### Setup your local `~/.ssh/config` and ssh keys Before your first time remotely connecting to the VEDA JupyterHub, you need to configure your local ssh. +1. Create a set of ssh keys for logging into the Hub. + + ```bash + ssh-keygen -t ed25519 -C "your_email@example.com" -f ~/.ssh/id_ed25519_hub + ``` + + This creates `~/.ssh/id_ed25519_hub` and `~/.ssh/id_ed25519_hub.pub` on your local machine. +1. Add the public key to github + 1. Sign into github.com + 2. Navigate to Settings > SSH and GPG keys + 3. Click "New SSH key" and paste the contents of `~/.ssh/id_ed25519_hub.pub` into the "Key" field + 1. Add an entry that looks like the following to the end of your ~/.ssh/config. Create it if it does not exist. ```bash Host hub.openveda.cloud User jovyan + IdentityFile ~/.ssh/id_ed25519_hub ProxyCommand websocat --binary -H='Authorization: token ' asyncstdio: wss://%h/user//sshd/ ``` -2. Replace `` with the token you created earlier. -3. Replace `` with your VEDA JupyterHub username. +1. Replace `` with the token you created earlier. +1. Replace `` with your VEDA JupyterHub username. ### Setup ssh keys on your JupyterHub server From 201087843ddec134b8b7be13d7db4e27cfb74a70 Mon Sep 17 00:00:00 2001 From: ameliaholcomb Date: Wed, 3 Jun 2026 15:39:39 +0000 Subject: [PATCH 2/2] Remove github intermediary, add info for custom server names --- user-guide/scientific-computing/ssh.md | 41 ++++++++++++++++---------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/user-guide/scientific-computing/ssh.md b/user-guide/scientific-computing/ssh.md index 42a3aa81..5d3b73c4 100644 --- a/user-guide/scientific-computing/ssh.md +++ b/user-guide/scientific-computing/ssh.md @@ -38,36 +38,45 @@ Before your first time remotely connecting to the VEDA JupyterHub, you need to c ``` This creates `~/.ssh/id_ed25519_hub` and `~/.ssh/id_ed25519_hub.pub` on your local machine. -1. Add the public key to github - 1. Sign into github.com - 2. Navigate to Settings > SSH and GPG keys - 3. Click "New SSH key" and paste the contents of `~/.ssh/id_ed25519_hub.pub` into the "Key" field -1. Add an entry that looks like the following to the end of your ~/.ssh/config. Create it if it does not exist. +2. Add an entry like the following to the end of your ~/.ssh/config. Create it if it does not exist. ```bash - Host hub.openveda.cloud + Host veda-hub.default + HostName hub.openveda.cloud User jovyan IdentityFile ~/.ssh/id_ed25519_hub + IdentitiesOnly yes ProxyCommand websocat --binary -H='Authorization: token ' asyncstdio: wss://%h/user//sshd/ ``` -1. Replace `` with the token you created earlier. -1. Replace `` with your VEDA JupyterHub username. +3. Replace `` with the token you created earlier. +4. Replace `` with your VEDA JupyterHub username. +5. If using a custom named Veda server, add additional entries to your ssh config, specifying `` in the Host short name and the ProxyCommand fields: + ```bash + Host veda-hub. + HostName hub.openveda.cloud + User jovyan + IdentityFile ~/.ssh/id_ed25519_hub + IdentitiesOnly + ProxyCommand websocat --binary -H='Authorization: token ' asyncstdio: wss://%h/user///sshd/ + ``` ### Setup ssh keys on your JupyterHub server -You need to put some ssh public keys in `~/.ssh/authorized_keys` after you start your JupyterHub server and have completed the [setup of your private keys on your local machine](#setup-your-local-.sshconfig). +Put your ssh public key in `~/.ssh/authorized_keys` after you start your JupyterHub server and have completed the [setup of your private keys on your local machine](#setup-your-local-sshconfig-and-ssh-keys). 1. Launch a server from the [VEDA JupyterHub home page](https://hub.openveda.cloud/) if you don't already have one running. -2. Open a terminal in JupyterLab -3. Run the following commands, replacing with your github username: +2. Open a terminal in JupyterLab and run the following commands ```bash - mkdir -p ~/.ssh - wget https://github.com/.keys -O ~/.ssh/authorized_keys - chmod 0600 ~/.ssh/authorized_keys + mkdir -p ~/.ssh && chmod 700 ~/.ssh + cat >> ~/.ssh/authorized_keys + # copy-paste the contents of ~/.ssh/id_ed25519_hub.pub from your local machine + # then type Ctrl-D + chmod 600 ~/.ssh/authorized_keys ``` +This ssh key will be shared across all of your VEDA servers. ## Connect to JupyterHub @@ -79,7 +88,7 @@ There are two ways to connect to JupyterHub: [Connect to the JupyterHub using VS 2. Open a new VS Code Window on your local maachine. 3. Open the command prompt (command + shift + P on macOS) 4. Enter `Remote-SSH: Connect to Host...` -5. Select `hub.openveda.cloud` +5. Select `veda-hub.default` (or your custom server name, if you have set one up above) 6. Select "Open Folder" and select the specific folder that you want to work in. Now you're connected and ready to develop using VS Code! You may need to [install some extensions in the SSH server](#install-extensions) to use your regular development workflows. @@ -118,7 +127,7 @@ Exiting VS Code will also close the remote connection. 1. Launch a server from the [VEDA JupyterHub home page](https://hub.openveda.cloud/) if you don't already have one running. 2. Open a new terminal on your local machine. -3. Enter `ssh hub.openveda.cloud` +3. Enter `ssh veda-hub.default` You are now ssh'd into the JupyterHub! If you enter a command (e.g., `touch am-i-on-the-jupyterhub`), it will be run on the remote server.