栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

本地使用 jupyter notebook 连接远程服务器

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

本地使用 jupyter notebook 连接远程服务器

1. 服务器端 1.1 安装notebook

在服务器端安装notebook

pip install jupyter notebook  
1.2 开启 jupyter notebook

在服务器端开启 jupyter notebook,–no-browser 是不自动打开浏览器:

jupyter notebook --no-browser

jupyter服务默认发布至本地的8888端口,开启成功后会出现如下界面:

注:复制倒数第二行的 token,这个 token 就是远程访问的密码,同时记下端口号8888。

2. PC端 2.1 端口映射

在 PC 端做一个端口映射,即通过 ssh 隧道来将服务器端的8888端口号映射到本地(PC端)的某个端口(如1234):

ssh -L 1234:localhost:8888 username@xxx.xxx.xxx.xxx
# username@xxx.xxx.xxx.xxx 为服务器的登录名和IP地址

接着输入服务器的访问密码,这时就可以在PC端的浏览器通过

http://localhost:1234

直接访问服务器上的 jupyter notebook 了。

2.2 输入密码

打开 http://localhost:1234 后,会出现如下界面:

在Password or token 的输入框内输入之前复制的 token 就可以远程访问了。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/893627.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号