遠程訪問Jupyter notebook

  1. 生成配置文件
jupyter notebook --generate-config 
複製代碼

2.進入ipython,設置jupyter登陸密碼並獲取sha1值python

In [1]: from notebook.auth import passwd

In [2]: passwd()
複製代碼

3.在vim ~/.jupyter/jupyter_notebook_config.py中添加配置,並保存vim

c.NotebookApp.ip=‘0.0.0.0’#其中0.0.0.0表明本機上的全部IPV4地址,'*' 則意味着綁定全部接口 (ips),若報錯可試這二者

c.NotebookApp.password=u'sha1:9837a753f9dc:852f7c71f4bd6158118201c35ef1f2aca877c57e' #在步驟2中得到的值

c.NotebookApp.open_browser=False

c.NotebookApp.port=8880#該服務監聽的端口號
複製代碼

4.指定ip而且後臺運行,Session斷開也繼續運行瀏覽器

nohup jupyter notebook --ip=192.168.2.2 &     
複製代碼

5.以後在瀏覽器中,輸入ip:端口便可bash

相關文章
相關標籤/搜索