如何连接到远程Jupyter笔记本服务器?

时间:2018-03-30 04:01:36

标签: python linux jupyter-notebook remote-access remote-server

我想在我jupyter notebook访问权限的计算机上运行ssh服务器,并且我已经能够在本地运行笔记本。

如何设置jupyter notebook以便远程访问

1 个答案:

答案 0 :(得分:4)

如果您对将运行服务器的计算机具有ssh访问权限,请执行以下步骤:

1)在您将运行服务器的机器中,执行:

jupyter notebook # To start the server with the default port forwarding (8888)

2)记下笔记本地址:将在终端显示:http://localhost:8888/?token=<A_LONG_STRING_OF_NUMBERS_AND_LETTERS>

3)在客户端计算机中,远程访问服务器:

ssh -N -L localhost:8888:localhost:8888 <server_username>@<server_ip>

4)现在,打开浏览器以使用以下地址:http://localhost:8888/?token=<THE_TOKEN>

其他信息(找到here):可以更改设置服务器的端口

# In the server
jupyter notebook --no-browser --port=8889

# In the client
ssh -N -L localhost:8888:localhost:8889 <server_username>@<server_ip>