먼저 서버의 ip 주소를 확인한다.
ip addr show
config 파일을 생성한다.
jupyter notebook --generating-config
그럼 user home 경로에 다음과 같은 config 파일이 생성된다.
/data001/~~~~~~/.jupyter/jupyter_notebook_config.py
서버 비밀번호를 생성한다. (안해도됨)
터미널을 새로 열고
ipython
In [1] : from notebook.auth import passwd
In [2] : passwd()
Enter password:
Verify password:
Out [2] : 'argon2:~~~~~~' # 입력한 비밀번호를 암호화해서 반환해줌
In [3] : quit() # 빠져나옴
주의할 점은 비밀번호를 입력할 때, 아무것도 안뜬다. 잘 입력되고 있는 것이니 걱정하지 말고 입력 후에 Enter
암호화된 비밀번호를 복사해두고
주피터 서버 환경설정을 한다.
앞서 생성한 config 파일을 열어서 수정한다.
vi ~/.jupyter/jupyter_notebook_config.py
# Configuration file for jupyter-notebook
여기에 입력
#-------------------------------------------------------
# Application(SingletonConfigurable) configuration
#-------------------------------------------------------
# Configuration file for jupyter-notebook
c = get_config()
c.NotebookApp.allow_origin = '*' # 외부 접속 허용
c.NotebookApp.ip = '127.0.0.1' # 맨 처음에 찾아둔 ip 주소 입력
c.NotebookApp.open_browser = False # 시작 시 브라우저 실행 안함
c.NotebookApp.password = 'argon2:~~~~' # 복사해둔 암호 붙여넣기
c.NotebookApp.password_required = True
c.NotebookApp.port = 8888
#-------------------------------------------------------
# Application(SingletonConfigurable) configuration
#-------------------------------------------------------
~~~
:wq # 저장하고 빠져나오기
Jupyter Notebook 실행하기
jupyter notebook
'개발' 카테고리의 다른 글
[Linux] chmod(change mode)로 접근 권한 지정하기 (0) | 2023.03.17 |
---|---|
[Linux] 명령어 Is 옵션의 의미, ls -l 영역별 의미 (0) | 2023.03.17 |
[에러해결] Could not load the Qt platform plugin "xcb" (0) | 2023.01.27 |
[Linux] MySQL 명령어 : 접속, 데이터베이스, 사용자 계정 생성 등 (0) | 2022.10.12 |
[Python] argparse 사용법 - 파이썬 인자 처리 (1) | 2022.09.23 |