Ok, so, I've got a GPU laptop that I use for ML and I leave it at my firewalled office (it's a big lump of a thing). That GPU laptop maintains a reverse-SSH connection to my own personal server so that I can access it from elsewhere. When I'm at the office, I SSH to my personal server and then from there SSH to the GPU laptop and run Jupyter notebooks on my desktop using the GPU of the laptop, for example.

When I'm at home, I like to be able to access the laptop to check how it's doing remotely and I do this, similarly, by SSHing to my personal server and then to the GPU laptop.

All this works fine, except I'm having a problem with accessing ports on my home laptop so that I can run Jupyter at home using the GPU laptop. Let's use simple terminology to talk about what's happening:

  • O: the office desktop computer
  • S: the personal server
  • G: the GPU laptop
  • H: the home laptop

On G, Jupyter is set running in a tmux session using a command like the following:

jupyter notebook --no-browser --port=<Port-G>

This sets Jupyter going with a special port and it gives a security token printout.

Now, from O, I can run a command of the following form, which routes through S:

ssh -L<Port-O>:localhost:<Port-S> user@Host-S -t ssh -L<Port-S>:localhost:<Port-G> user@Host-G

In practice, it's like this:

ssh -L 19508:localhost:19508 user@www.example.org -t ssh -L 19508:localhost:19508 user@localhost -p 19507

Then on O I can happily open the Jupyter notebook running on G in a browser using a URL like http://localhost:19508.

So, super. At the end of the day, at the office, I set something running on the GPU laptop G and then I close off the connection on the office desktop computer O and head home.

But then, as the capitalist wage laborer that I am, I decide to try to run the Jupyter notebook on my home laptop H at home. When I try to run that same command that I run on my work desktop O, I am flattly refused! The port is inaccessible.

What might be going wrong? Have I done something just made silly? Thanks for any thoughts!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.