Xshell 配置Jupyter Notebook远程访问

1、在xshell界面安装Jupyter Notebook(可直接安转载anaconda虚拟环境中);

pip install ipython

pip install jupyter

2、生成配置文件:

[root@50eb5057baac /]# jupyter notebook --generate-config

Writing default config to: /root/.jupyter/jupyter_notebook_config.py

3、生成密码:

root@50eb5057baac /]# python  
Python 3.5.1 (default, Oct 21 2016, 21:37:19)   
Type 'copyright', 'credits' or 'license' for more information  
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.  
  
In [1]: from notebook.auth import passwd  
  
In [2]: passwd()  
Enter password:   
Verify password:   
Out[2]: 'sha1:43b95b731276:5d330ee6f6054613b3ab4cc59c5048ff7c70f549'  
  
此步骤主要生成'sha1:43b95b731276:5d330ee6f6054613b3ab4cc59c5048ff7c70f549'  秘钥,应用于修改配置文件;

4、修改默认配置文件

vi /root/.jupyter/jupyter_notebook_config.py

c.NotebookApp.ip='*' #设置访问notebook的ip,*表示所有IP,这里设置ip为都可访问  
c.NotebookApp.password = u'sha1:5df252f58b7f:bf65d53125bb36c085162b3780377f66d73972d1' #填写刚刚生成的密文  
c.NotebookApp.open_browser = False # 禁止notebook启动时自动打开浏览器(在linux服务器一般都是ssh命令行访问,没有图形界面的。所以,启动也没啥用)  
c.NotebookApp.port =8889 #指定访问的端口,默认是8888。

5、配置Xshell

右击会话属性。点击隧道,添加监听端口;

设置监听端口和目标主机端口,监听端口随意设置,目标端口一般为8888

6、启动jupyter notebook

[root@346086094cbe /]# jupyter notebook --allow-root  
[W 17:17:04.106 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.  
[I 17:17:04.111 NotebookApp] Serving notebooks from local directory: /  
[I 17:17:04.112 NotebookApp] 0 active kernels  
[I 17:17:04.112 NotebookApp] The Jupyter Notebook is running at:  
[I 17:17:04.112 NotebookApp] http://[all ip addresses on your system]:8889/  
[I 17:17:04.112 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
7、然后你就可以在浏览器里敲入你的地址 http://yourip:2345/, 即可看到登录界面;yourip为[I 17:17:04.112 NotebookApp] http://[all ip addresses on your system]:8889/  提示IP;

8、如果自己租用的服务器,则jupyter notebook登录密码为租用方提供的jupyter notebook登录密码;

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值