ubuntu通过jupyter访问远程服务器

尊重原创,请读原文。

转载自:远程访问服务器Jupyter Notebook的两种方法

**利用jupyter notebook自带的远程访问功能

官方指南在此:官方指南**

  1. 生成默认配置文件

    jupyter notebook --generate-config

  2. 生成访问密码(token)
    终端输入ipython,设置你自己的jupyter访问密码,注意复制输出的sha1:xxxxxxxx密码串

    In [1]: from notebook.auth import passwd
    In [2]: passwd()
    Enter password:
    Verify password:
    Out[2]: ‘sha1:xxxxxxxxxxxxxxxxx’

  3. 修改./jupyter/jupyter_notebook_config.py中对应行如下

    c.NotebookApp.ip=’*’
    c.NotebookApp.password = u’sha:ce…刚才复制的那个密文’
    c.NotebookApp.open_browser = False
    c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口
    c.NotebookApp.allow_remote_access=True # 这一句也要加上,不然会报错:

报错:socket.gaierror: [Errno -2] Name or service not known

  1. 在服务器上启动jupyter notebook

    jupyter notebook

  2. 最后在本地打开浏览器,访问:http://ip:8888/

云服务器打开8888端口

我使用的是天翼云,操作步骤为:

  • 控制中心
  • 虚拟私有云
  • 安全组
  • 入方向规则
    然后按图片参数添加一个规则,开放8888端口
    在这里插入图片描述
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值