conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda 安装 jupyterhub
conda install -c conda-forge jupyterhub
jupyterhub --generate-config -f /etc/jupyterhub/jupyterhub_config.py
# c.JupyterHub.ip = ''
c.JupyterHub.port = 8888 # 访问的端口
c.Spawner.ip = '127.0.0.1'
c.PAMAuthenticator.encoding = 'utf8'
c.Authenticator.whitelist = {'root','lanjing'} #默认不能使用root登录,需要修改配置, 这里的登陆是 linux 服务的登陆的用户名,jupyterhub 也是使用用户名和用户密码登陆
c.LocalAuthenticator.create_system_users = True
c.Authenticator.admin_users = {'root', 'lanjing'}
c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator'
c.JupyterHub.statsd_prefix = 'jupyterhub'
c.NotebookApp.notebook_dir = '/home/lanjing/python/' #jupyter 自定义目录使用
c.JupyterHub.statsd_prefix = 'jupyterhub'
c.JupyterHub.ssl_cert = '/usr/lajing/etc/certificate/_archive/xYa1nX/fullchain.pem'
c.JupyterHub.ssl_key = '/usr/lanjing/etc/certificate/_archive/xYa1nX/privkey.pem'
pip3 install jupyterhub-dummyauthenticator -i https://pypi.douban.com/simple/
然后,在配置文件中修改此配置:
c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator'