本文不赘述jupyter notebook安装过程,如果是虚拟机VMware中使用远程访问,建议先设置静态IP,可以参考这里
首先生成配置文件
jupyter notebook --generate-config
用ipython生成jupyter密匙
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'argon2:$argon2id$sssxxxxxs,p=8xxxxaaa7hnQ$yy1z/DuFZu7TWo0ZPGKJmg'
记录下argon2这段密匙
编辑配置文件
复制以下内容
vim ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip='xxx.xxx.xxx.xx' #改成你的服务器ip,设置* 就是设置所有ip皆可访问
c.NotebookApp.password = u'argon2:xxxxxxxxxxxxxxxxxxx' #刚才复制的那个密文
c.NotebookApp.open_browser = False # 禁止自动打开浏览器
c.NotebookApp.port =8889 #指定为NAT端口映射的端口号
启动jupyter notebook,复制地址到浏览器 完成