0

So I am having this remote machine, which is actually just a machine in the local network. I am running a Jupyter Notebook on that machine to which I was always able to access it via URL such as http://192.168.111.242/?token=asdfghjkl

However, lately this is not working for me and what I have to do is user port forwarding in order to make it work:

ssh -f username@name -L PORT:localhost:PORT -N

Otherwise, accessing http://192.168.111.242/?token=asdfghjkl will give me a ERR_CONNECTION_REFUSED in my browser.

I don't quite understand why I have to forward the port here.

What could be the reason?

6
  • Perhaps the machine's IP changed? Apr 24, 2018 at 13:48
  • @NerdOfLinux No, this is not the case. Apr 24, 2018 at 13:58
  • What OS is the remote machine running? Apr 24, 2018 at 13:59
  • @NerdOfLinux in this case Ubuntu 16.04 - same as my workstation Apr 24, 2018 at 14:10
  • What's the output of sudo ufw status? Apr 24, 2018 at 14:10

1 Answer 1

1

By default jupyter only binds to the localhost interface, so it can be used only from the local machine by connecting to 127.0.0.1. If you want to make it available on your network, you have to tell it to listen to the external IP address of your machine, or simply to all IP addresses available:

jupyter notebook --ip='*' --no-browser

This way you do not need to create a port fowarding to access your jupyter notebook.

However, keep in mind that using an ssh tunnel probably provides better security than letting jupyter listen on your network. In addition, the connection through the ssh tunnel would be encrypted, while the direct connection to jupyter most likely would not. It pretty much depends on how much you trust your network. If it is not 100% trustable consider using the ssh tunnel solution.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .