The SudoSpawner enables JupyterHub
to spawn single-user servers without being root, by spawning an intermediate
process via sudo
, which takes actions on behalf of the user.
The sudospawner
mediator, the intermediate process, can only do two things:
- send a signal to another process using the os.kill() call
- spawn single-user servers
Launching the sudospawner
script is the only action that requires a
JupyterHub administrator to have sudo
access to execute.
-
Install:
pip install -e .
-
To configure JupyterHub to use SudoSpawner, add the following to your
jupyterhub_config.py
:c.JupyterHub.spawner_class='sudospawner.SudoSpawner'
The JupyterHub documentation has additional information about creating a configuration file, if needed, and recommended file locations for configuration files.
The Dockerfile in this repo contains an example configuration for setting up a JupyterHub system, without any need to run anything as root.