jupyter notebook 一般安装在内网环境,其端口一般不对外开放。想要实现从外网来访问。
假设:jupyter notebook所在服务器可以通过远程 ssh访问
假设,服务器地址为 222.111.xxx.xxx,而 jupyer 运行服务器上的8888端口上
在你本机,执行:
ssh -N -f -L localhost:7777:localhost:8888 username@222.111.xxx.xxx
username 为你远程登录服务器的用户名,之后输入登录密码就可以了。
之后,使用你本机的浏览器输入 http://localhost:7777 即可访问。
这个命令是通过ssh的管道把服务器上看到的 localhost:8888, 映射到你本机的 localhost:7777上