Debug port forwarding for remote use of a Jupyter laptop

I am trying to use a Jupyter laptop on a remote computer. The setup is as follows: I have my home laptop, which can ssh to a specific computer on my university network (for example, gateway.myuniv.edu). As soon as I registered on gateway.myuniv.edu, I can ssh to the computer on which I would like to start the Jupyter laptop server (for example, cluster.myuniv.edu).

What works . I can start the server on the gateway and connect to it from my laptop using local port forwarding, as follows:

On gateway.myuniv.edu:$ jupyter notebook --no-browser --port 8888

On my laptop: $ ssh -v -N -L 9000:localhost:8888 myusername@gateway.myuniv.edu

Then in my laptop browser I will open the url: http://localhost:9000

What does not work . I do not want to start the server on the gateway, since I can not perform heavy calculations there. I tried to do the following:

On cluster.myuniv.edu:$ jupyter notebook --no-browser --port 8888

On my laptop: $ ssh -v -N -L 9000:cluster.myuniv.edu:8888 myusername@gateway.myuniv.edu

Then, on my laptop, I open the browser URL-address: http://localhost:9000. This does not work: SSH says the connection is rejected.

I do not understand why this will happen and how to debug it, I will be glad for any help. Thank!

+4
source share
1 answer

The problem is that you are forwarding port :8888on cluster.myuniv.eduto port :9000on gateway.myuniv.edu, and then forwarding port :8888on gateway.myuniv.eduto port 9000on your laptop.

:

cluster.myuniv.edu: $ jupyter notebook --no-browser --port 8888

gateway.myuniv.edu: $ ssh -v -N -L 8888:localhost:8888 myusername@cluster.myuniv.edu

: $ ssh -v -N -L 9000:localhost:8888 myusername@gateway.myuniv.edu

Jupyter- ( ) ssh ( ) Tmux Screen, ,

+2

Source: https://habr.com/ru/post/1650304/


All Articles