Hi @tolevski ,
I gave this another try.
This time I deleted my blank project and recreated another on Renkulab with the same name (FYI : Reproducible Data Science | Open Research | Renku).
$ renku clone https://gitlab.renkulab.io/champak.beeravolureddy/launch-ssh-session-from-cli.git
Cloning https://gitlab.renkulab.io/champak.beeravolureddy/launch-ssh-session-from-cli.git ...
remote: Counting objects: 100% (58/58), done.
remote: Compressing objects: 100% (44/44), done.
OK
$ renku login https://renkulab.io
Warning: Cannot log in to git outside a project.
Please grant access to 'renku-cli' in your browser.
If a browser window does not open automatically, go to https://renkulab.io/auth/realms/Renku/device?user_code=NKME-TENF
Successfully logged in.
$ cd launch-ssh-session-from-cli/
$
$ renku session start -p renkulab --ssh
Your system is not set up for SSH connections to Renkulab. Would you like to set it up? [y/N]: y
Info: Generating keys
Info: Writing SSH config
Info: Adding SSH public key to project.
Info: Added public key. Changes need to be pushed and remote image built for changes to take effect.
Error: Please run the renku login command to authenticate with Renku.
This error is strange as I just logged into Renkulab a short while ago with browser-based authentication !
However, an SSH key pair (gitlab.renkulab.io-key.pub
) has been generated in ~/.ssh/renku/
along with a 99-gitlab.renkulab.io-jumphost.conf
file containing following the jumphost details :
Host jumphost-gitlab.renkulab.io*
HostName gitlab.renkulab.io
Port 2022
User jovyan
So I logged in from the CLI a second time as suggested…
$ renku login https://renkulab.io
Warning: Remote URL will be changed. Do you want to continue (to disable this warning, pass '--yes' or run 'renku config set show_login_warning False')? [y/N]: y
Please grant access to 'renku-cli' in your browser.
If a browser window does not open automatically, go to https://renkulab.io/auth/realms/Renku/device?user_code=ORAA-QTXQ
Successfully logged in.
And then…
$ git push
Locking support detected on remote "origin". Consider enabling it with:
$ git config lfs.https://renkulab.io/repos/champak.beeravolureddy/launch-ssh-session-from-cli.git/info/lfs.locksverify true
Counting objects: 4, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 459 bytes | 459.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
To https://renkulab.io/repos/champak.beeravolureddy/launch-ssh-session-from-cli.git
01b765e..4a13043 master -> master
$ renku session start -p renkulab --ssh
Your system is not set up for SSH connections to Renkulab. Would you like to set it up? [y/N]:
Error: Can't run ssh session without setting up Renku SSH support. Run without '--ssh' or run 'renku session ssh-setup'.
The error is once again strange as SSH access was already setup via the commit “Add public SSH key.” and was pushed to Renkulab and I waited until the Docker image was built before starting a session.
$ renku session start -p renkulab --ssh
Your system is not set up for SSH connections to Renkulab. Would you like to set it up? [y/N]: y
Info: Generating keys
Info: Writing SSH config
Info: Adding SSH public key to project.
Info: Added public key. Changes need to be pushed and remote image built for changes to take effect.
Image registry.renkulab.io/champak.beeravolureddy/launch-ssh-session-from-cli:9d03ee1 built successfully.
Session champak-2e-launch-2dssh-2dsession-2-4feaf1a1 successfully started, use 'renku session open --ssh champak-2e-launch-2dssh-2dsession-2-4feaf1a1' or 'ssh champak-2e-launch-2dssh-2dsession-2-4feaf1a1' to connect to it
Now this part is where it gets weirder as different SSH key pair (renkulab.io-key.pub
) is generated in ~/.ssh/renku/
along with a different .conf
file (99-renkulab.io-jumphost.conf
) containing the following :
Host jumphost-renkulab.io*
HostName renkulab.io
Port 2022
User jovyan
So was the previous remote (jumphost-gitlab.renkulab.io*
) only a Gitlab specific host !? This time, a commit containing both the keys to .ssh/authorized_keys
is pushed automatically to remote : Commits · master · Champak Beeravolu Reddy / launch ssh session from cli · GitLab
Also, a new .conf
file (00-launch-ssh-session-from-cli-champak-2e-launch-2dssh-2dsession-2-4feaf1a1.conf
) appears with :
Host champak-2e-launch-2dssh-2dsession-2-4feaf1a1
HostName champak-2e-launch-2dssh-2dsession-2-4feaf1a1
RemoteCommand cd work/launch-ssh-session-from-cli/ || true && exec $SHELL --login
RequestTTY yes
ServerAliveInterval 15
ServerAliveCountMax 3
ProxyJump jumphost-renkulab.io
IdentityFile /home/champost/.ssh/renku/renkulab.io-key
User jovyan
StrictHostKeyChecking no
And finally when I attempt to connect wither way (with or without CLI) to the running session :
$ renku session ls
Session champak-2e-launch-2dssh-2dsession-2-4feaf1a1 (running, renkulab)
Started: 2023-08-22T12:40:54+00:00
Url: https://renkulab.io/projects/champak.beeravolureddy/launch-ssh-session-from-cli/sessions/show/champak-2e-launch-2dssh-2dsession-2-4feaf1a1
Commit: 9d03ee16a9c8cab33b92f784c3a8ea3ea1046278
Branch: master
SSH enabled: yes
$
$ renku session open --ssh champak-2e-launch-2dssh-2dsession-2-4feaf1a1
Warning: Permanently added 'champak-2e-launch-2dssh-2dsession-2-4feaf1a1' (ECDSA) to the list of known hosts.
Received disconnect from UNKNOWN port 65535:2: Too many authentication failures
Disconnected from UNKNOWN port 65535
$
$ ssh -J jovyan@renkulab.io:2022 jovyan@champak-2e-launch-2dssh-2dsession-2-4feaf1a1
Received disconnect from UNKNOWN port 65535:2: Too many authentication failures
Disconnected from UNKNOWN port 65535
$
$ renku session ssh-setup
Keys already configured for host renkulab.io. Overwrite? [y/N]:
Aborted!
$
Voilà !