通过 ssh 连接到 jupyter 笔记本服务器时出现问题

luc*_*per 5 linux ssh ssh-tunnel jupyter jupyter-notebook

我曾经能够很好地建立从我家到我工作机器(不同网络)jupyter 服务器的连接。它在没有任何明显原因的情况下停止工作。我的 MacBook 仍然可以连接,所以遥控器没问题。

我设置服务器:
jupyter notebook --no-browser --port=8887

然后我尝试转发:
ssh -N -L localhost:8887:localhost:8887 $user@$host

但这总是超时:
connect to host $host port 22: Connection timed out

通过 ssh 终端登录远程计算机工作正常。有什么想法如何找到问题吗?提前致谢。

小智 1

尝试:

jupyter notebook --no-browser --port=8888
Run Code Online (Sandbox Code Playgroud)

(您可能会得到另一个号码,例如 8889。如果您得到另一个号码,那么您也必须更改下面的号码。)

然后打开一个新终端,输入:(记得改成remoteuser@remotehost)

ssh -N -f -L localhost:8889:localhost:8888 remoteuser@remotehost
Run Code Online (Sandbox Code Playgroud)

查看这篇文章以获取更多详细信息和演练:https://ljvmiranda921.github.io/notebook/2018/01/31/running-a-jupyter-notebook/