服务器(CentOS7)配置Jupyter Notebook远程访问
程序员文章站
2022-05-28 11:37:35
...
目录
在安装好anaconda后
检查本地是否安装成功并生成配置文件
jupyter notebook –generate-config –allow-root
- 1
生成远程访问密码
利用ipython生成密码
[[email protected] ~]# ipython
Python 3.6.2 |Anaconda, Inc.| (default, Sep 30 2017, 18:42:57)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: '*******'
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
修改配置文件
vi /root/.jupyter/jupyter_notebook_config.py
- 1
c.NotebookApp.ip='*'
c.NotebookApp.password = u'*******'将上述生成的密码复制到这里
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888
- 1
- 2
- 3
- 4
测试远程访问
远程连接服务器后,终端输入Jupyter notebook
打开服务。在浏览器中输入<serverip>:8888
,测试是否访问成功,访问不成功请将服务器防火墙关闭:
systemctl stop firewalld.service
- 1
<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-7b4cdcb592.css" rel="stylesheet">
</div>
</article>