201216-JupyterLab伺服器遠端配置

GuokLiu發表於2020-12-17

如何獲取遠端伺服器的金鑰

python
from IPython.lib import passwd 
passwd()                                                                                                                                                       
Enter password: 
Verify password:
'sha1:xxxxxxxxxxxxx'

如何生成jupyter配置檔案(不同平臺檔案地址不同)

jupyter notebook --generate-config

如何修改jupyter配置檔案

vim /root/.jupyter/jupyter_notebook_config.py

如何基本配置

c.NotebookApp.allow_origin = '*' 				    # 允許所有外部訪問
c.NotebookApp.ip = '0.0.0.0' # default 'localhost'  # 表示所有ip地址
c.NotebookApp.allow_root = True 				    # 允許root許可權
c.NotebookApp.notebook_dir = '/root/Project/'       # jupyter初試目錄
c.NotebookApp.open_browser = False			        # 用外部瀏覽器開啟
c.NotebookApp.password ='sha1:xxxxxxxxxxxxx’        # 前面生成的金鑰
c.NotebookApp.port = 8080					        # jupyter外部訪問埠號

Reference

  1. Why I can’t access remote Jupyter Notebook server?

[1] Dropping localhost from ::1 worked:
[2] the easiest way to solve is, in etc/hosts just remain this one

  1. OSError: [Errno 99] Cannot assign requested address

  2. 配置jupyter notebook網頁瀏覽

相關文章