software 설치/제거 메뉴에서
1. jupyter interactive notebook 찾아서 설치
2. interactive computing environment (metapackage) 설치
3. 환경설정
$ jupyter notebook --generate-config
4. 암호설정
$ jupyter notebook password
Enter password: ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json
5. 해시된 패스워드 준비
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
이 패스워드를 jupyter_notebook_config.py에 다음과 같은 항목에 넣는다.
c.NotebookApp.password = u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
일단 이렇게 하면 앞의 jason 파일은 확장자를 고치고( *.org 처럼) 없앤다.
6. SSL 접속을 위한 준비
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem
이렇게 mykey.key, mycert.pem 2가지 파일을 만든다.
5. 외부접속을 위한 설정 파일 수정
.jupyter/jupyter_notebook_config.py를 수정
c.NotebookApp.allow_origin='*'
c.NotebookApp.allow_remote_access=True
c.NotebookApp.open_browser=False
c.NotebookApp.certfile = '/absolute/path/mycert.pem'
c.NotebookApp.keyfile = '/absolute/path/mykey.key'
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888
참고
1. https://jupyter-notebook.readthedocs.io/en/stable/public_server.html
2. https://m.blog.naver.com/seodaewoo/221710100262