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

How to connect to a remote Jupyter notebook server?

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

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

如果您可以通过 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>