nic*_*ico 5 python linux remote-access remote-server jupyter-notebook
我想jupyter notebook在我有权ssh访问并且我已经能够在本地运行笔记本的机器上运行服务器。
如何设置jupyter notebook以便远程访问?
如果您对将运行服务器的计算机具有 ssh 访问权限,请执行以下步骤:
1)在您将运行服务器的机器上,执行:
jupyter notebook # To start the server with the default port forwarding (8888)
Run Code Online (Sandbox Code Playgroud)
2)记下笔记本地址:它将在终端中显示给您:http://localhost:8888/?token=<A_LONG_STRING_OF_NUMBERS_AND_LETTERS>
3)在客户端机器上,远程访问服务器:
ssh -N -L localhost:8888:localhost:8888 <server_username>@<server_ip>
Run Code Online (Sandbox Code Playgroud)
4) 现在,打开浏览器使用以下地址: http://localhost:8888/?token=<THE_TOKEN>
附加信息(在这里找到):可以更改设置服务器的端口
# In the server
jupyter notebook --no-browser --port=8889
# In the client
ssh -N -L localhost:8888:localhost:8889 <server_username>@<server_ip>
Run Code Online (Sandbox Code Playgroud)