jupyter notebook as a server

本文介绍如何设置Jupyter Notebook作为服务器使用,包括配置文件的创建、设置密码保护、SSL证书的生成及配置项的详细说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Prerequisite: A notebook configuration file

Check to see if you have a notebook configuration file, jupyter_notebook_config.py. the default location for this file is your Jupyter folder in your home directory, ~/.jupyter.

If you don't already have one, create a config file for the notebook using the following command:

$ jupyter notebook --generate-config

 

You can setup a password for your notebook server with a single command. it store at you jupyter_notebook_config.json file.

$ jupyter notebook password
Enter password: ***
Verify password: ***

also you can encrypt your password, in python environment:

from notebook.auth import passwd
passwd()

Enter password:
Verify password:

 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'

 

if you want to openssl function:

$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem

 

config your jupter_notebook_config.py file. I didn't use = u'xxx' options

# Set options for certfile, ip, password, and toggle off
# browser auto-opening
c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'
c.NotebookApp.keyfile = u'/absolute/path/to/your/certificate/mykey.key'
# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...<your hashed password here>'
c.NotebookApp.open_browser = False

# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 9999

 

run jupyter notebook command.

 

All of config from http://jupyter-notebook.readthedocs.io/en/stable/public_server.html

posted on 2017-11-18 08:31 ecwork 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/ecwork/p/7855860.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值