https://hsaghir.github.io/data_science/jupyter-notebook-on-a-remote-machine-linux/
总结一下: 1. 登录远程计算机
user@local_host$ ssh user@remote_host
remote_user@remote_host$ jupyter notebook --no-browser --port=8889
2. 在新的终端中:
user@local_host$ ssh -N -L localhost:8888:localhost:8889 remote_user@remote_host
3. 然后打开浏览器并进入
localhost:8888
现在我的问题是: 我只能通过两个步骤访问远程计算机
ssh -X username@server
ssh -KX my_pc_name
我的电脑上只安装了jupyter笔记本。
当我用较长的登录过程替换第一步的第一行时,第二步该写什么?
当我插入remote_user = username and remote_user = my_pc_name时,jupyter笔记本会出现一个安全错误,要求输入令牌。步骤一获得的令牌不起作用。
其中一个解决方案是将两个ssh登录步骤合并为一个步骤。
ssh -X username@server
将您从本地计算机(Host-A,localhost)连接到跳板服务器(Host-B,server)。一旦连接成功,您运行ssh -KX my_pc_name
,这将使您连接到 Host-C,即 my_pc_name。 - Kai Aeberli