https://jupyterhub.readthedocs.io/en/stable/reference/config-sudo.html describes the setup with sudospawner a bit.