Reputation: 311
can anyone help to answer my question below:
I have a ubuntu server behind the router, the ubuntu server ip is static assigned by me as 192.168.1.100
. Docker is running on the ubuntu server.
I have set up port forwarding of the route so that I can remote ssh access to the ubuntu server. I have tested from another computer behind the router and I can successfully access the jupyter notebook on the docker by 192.168.1.100:8888
.
However, when I tried to access from a computer outside the router, I failed to access the jupyter notebook. May I ask what IP shall I use or how can I access from the outside?
Upvotes: 1
Views: 1964
Reputation: 176
The easiest and safest way would probably be to create an SSH-tunnel - that way you don't have to expose your Jupyter server to the public internet.
In Putty, under the tab Connection -> SSH -> Tunnels, enter the following:
source-port: 8888
destination-port: 192.168.1.100:8888
Click add and then start the session like normal. Now your client machine's port 8888 will be tunneled to the server's port 8888. You can check if that works by running nc -l -p 8888
on the server and entering http://localhost:8888
in your client's browser. The request should then show up on the server.
In order to get this to work with Jupyter instead of netcat, you might need to set some options, as Jupyter is very picky when it comes to non-local connections:
# Allow connections to come from anywhere
c.NotebookApp.allow_origin = '*'
# Allow connections to refer to the server however they want to
c.NotebookApp.ip = '*'
You should also make sure you have some sort of access control enabled in Jupyter, as otherwise anyone with access to your client's port 8888 will have access to Jupyter.
Upvotes: 1