将jupyter notebook 远程服务器映射到本地

远程服务器端

1. 生成jupyter notebook配置文件(终端输入命令)

jupyter notebook --generate-config

2. 打开配置文件

vi ~/.jupyter/jupyter_notebook_config.py

3. 编辑配置文件

c.ServerApp.ip = '0.0.0.0'
c.ServerApp.port = 8888
c.ServerApp.allow_remote_access = True
c.ServerApp.password = 'your_password_here' #生成的哈希密码
c.ServerApp.notebook_dir = '/path/to/your/notebook/directory' # jupyter 实际安装位置

在终端输入

jupyter notebook password

输入您想要的密码,然后系统将生成哈希值。将生成的哈希值复制并粘贴到配置文件中。

4. 重启jupyter notebook

jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser

或者,这一步还可以在服务器上用 nohup 后台挂起运行jupyter:

nohup jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser > jupyter.out 2>&1 &

本地

5.使用ssh将jupyter notebook 映射到本地

ssh  -L8888:localhost:8888 your_username@remote_server_ip #服务器的8888端口隐射到本地的8888端口

Linux 查看端口占用情况Jupyter Notebook介绍、安装及使用教程 - 知乎 (zhihu.com)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值