How to Access a Remote Server?
When you run ipython notebook on a remote server using the following command
jupyter notebook –no-browser –port=8889
You will see:
The Jupyter Notebook is running at:
In this case, you cann’t use the link:
public_IP_address:8889 or domain_name:8889
to get access to the Ipython Notebook Server.
You can do some config to allow the Ipython notebook server to run on the public IP address, but this will cause security problems.
A good way is to use ssh tunnel, so that We can get access to the remote server on a local machine.
On a Linux or Mac Client
If your local machine has ssh supported shell (e.g., Mac or Linux client)
you can start a ssh tunnel using the following command:
-N -f -L localhost:8888:localhost:8889
Then on the local machine, open your browser and type in:
It will display IPython notebook server running on the remote server.
On a Windows Client using Putty
- open putty client
- Session -> put your hostname and port = 22, just as what you did normally to connect to you remote server.
- Connection -> SSH -> Tunnels
In the destination port box, enter: 127.0.0.1:8889, And select Local and Auto options.
In the Source port, enter: 8888, Then click the Add button,
you will see L8888 127.0.0.1:8889 in the box under the Remove button.
- Now you can open the session, and on your local machine, type