Open junxnone opened 5 years ago
pip3 install jupyterhub sudo -E npm install -g configurable-http-proxy
docker run -d -p 8000:8000 --name jupyterhub jupyterhub/jupyterhub jupyterhub
Create jupyterhub user, Install sudospawner to use PAM
sudo useradd jupyterhub sudo pip install sudospawner sudo visudo
To make PAM works, add this lines:
Cmnd_Alias JUPYTER_CMD = /usr/local/bin/sudospawner %jupyterhub ALL=(jupyterhub) /usr/bin/sudo jupyterhub ALL=(%jupyterhub) NOPASSWD:JUPYTER_CMD
sudo adduser -G jupyterhub your_username
Generate the config file
jupyterhub --generate-config -f config/jupyterhub_config.py
sudo -u jupyterhub jupyterhub --JupyterHub.spawner_class=sudospawner.SudoSpawner \ -f ./config/jupyterhub_config.py
diff with the origin config file
< #c.JupyterHub.admin_access = False --- > c.JupyterHub.admin_access = True 48a49 > c.JupyterHub.admin_users = {'name','name','name'} 167c168 < #c.JupyterHub.data_files_path = '/usr/local/share/jupyterhub' --- > #c.JupyterHub.data_files_path = '/home/name/.local/share/jupyterhub' 318c319 < #c.JupyterHub.ip = '' --- > c.JupyterHub.ip = 'your_ip' 356c357 < #c.JupyterHub.port = 8000 --- > c.JupyterHub.port = 8000 464c465 < #c.JupyterHub.statsd_prefix = 'jupyterhub' --- > c.JupyterHub.statsd_prefix = 'jupyterhub' 636a638 > c.Spawner.env_keep.append('LD_LIBRARY_PATH') 820a823 > c.Authenticator.admin_users = {'name','name','name','name'} 933a937 > c.Authenticator.whitelist = {'name','name','name','name','name','name'}
name is your users
junxnone/Linux#52
Reference
Brief
Install
Install on host
Install with Docker
Configure
Host
Create jupyterhub user, Install sudospawner to use PAM
To make PAM works, add this lines:
Generate the config file
diff with the origin config file