远程连接jupyter
1.下载jupyter
pip3 install jupyter
2.启动ipython3,为登录jupyter时设置密码
from notebook.auth import passwd
passwd()
输入密码两次
将output里面引号中间的一串加密密码串保存下来。
3.配置jupyter
#首先输入
jupyter notebook --generate-config
在~/.jupyter文件夹下就有 jupyter_notebook_config.py
输入jupyter notebook --generate-config
,在~/.jupyter
文件夹下就有jupyter_notebook_config.py
这一文件,编辑其文件:
vim jupyter_notebook_config.py
在最前面添加
c = get_config()
c.NotebookApp.ip ='*'
c.NotebookApp.password = u'ipython3生成的加密密码串'
c.NotebookApp.open_browser = False
c.NotebookApp.port =9009
找到allow_remote_access
,将其设为True,即:c.NotebookApp.allow_remote_access = True
(原本是False,现在改为True)
4.启动远程jupyter notebook
wq保存退出后,输入jupyter notebook即可启动服务器端jupyter。
打开浏览器,输入服务器ip地址:9009
即可访问远程jupyter notebook。
输入当时在ipython3中输入两次设置的密码即可登录远程jupyter notebook。