yuvipanda / jupyterhub-ssh

SSH Access to JupyterHubs
BSD 3-Clause "New" or "Revised" License
93 stars 29 forks source link

Support running non-interactive commands #41

Open yuvipanda opened 3 years ago

yuvipanda commented 3 years ago

If you run ssh <hostname> echo hi, users expect it to log in, run just that command, show its output, and log out. No interactive terminal is needed.

Right now, jupyterhub-ssh always puts you in an interactive terminal. This is not expected behavior.

We communicate with the notebook server using the terminado api used by terminals in jupyter notebook. It defaults to setting up for interactive use. We can instead wrap the user command in something that runs it non-interactively, and close our connection when that is done.

This might help with stuff like rsync not working

fperez commented 3 years ago

Excellent, thanks for filing this issue Yuvi! Along these lines, I am not sure if there are any differences as of today, but it's worth checking that the environment is also handled similarly to "normal" ssh - I know in the past I've had to set things up carefully handling env variables for the ssh host...

I agree that conforming to this interactive/non behavior should help with multiple things that tunnel through ssh (rsync and friends). Thx again!