I’m trying to install and run JupyterHub on an Ubuntu 20.04 server.
I would like to install JupyterHub with no authentication, since for now I’ll only be sharing notebooks with folks that will just browse them (I do not need proper auth for people that will edit/create notebooks, as required when you are doing classroom grading and such).
At first I thought I’d want to install tmpauthenticator, but I ended up really not liking the idea of creating a new Unix user for each and every visit to the page; so I thought, dummy is likely to get easier?
Anyways, I got to this setup:
$ grep authenticator_class /home/jupyter/.jupyter/jupyterhub_config.py # e.g. `c.JupyterHub.authenticator_class = 'pam'` # c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator' #c.JupyterHub.authenticator_class = 'tmpauthenticator.TmpAuthenticator' c.JupyterHub.authenticator_class = 'dummy'
… but then I got an error - here from syslog:
Sep 16 15:18:36 srv004808 jupyterhub: [I 2021-09-16 15:18:36.503 JupyterHub provider:574] Creating oauth client jupyterhub-user-0a3b9869-d0e1-4e60-827f-3fb6e7de29e6 Sep 16 15:18:36 srv004808 jupyterhub: [E 2021-09-16 15:18:36.515 JupyterHub user:718] Unhandled error starting 0a3b9869-d0e1-4e60-827f-3fb6e7de29e6's server: "getpwnam(): name not found: '0a3b9869-d0e1-4e60-827f-3fb6e7de29e6'"
I’m pretty sure this error occurs, because I’m trying to run jupyterhub under a non-sudo user; but then, as far as I understood, dummy authenticator should not create new users?!
Anyways, then I found this:
I think DummyAuthenticator doesn’t create users on your system. With DummyAuthenticator, you generally want to use a Spawner that doesn’t map onto system users, such as DockerSpawner.
Oh cool - then I should go with DockerSpawner?
$ grep 'authenticator_class\|spawner_class' /home/jupyter/.jupyter/jupyterhub_config.py # e.g. `c.JupyterHub.authenticator_class = 'pam'` # c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator' #c.JupyterHub.authenticator_class = 'tmpauthenticator.TmpAuthenticator' c.JupyterHub.authenticator_class = 'dummy' # e.g. `c.JupyterHub.spawner_class = 'localprocess'` # c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner' c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner' $ pip3 install dockerspawner $ sudo systemctl restart jupyterhub
… but now when I visit the page:
500 : Internal Server Error
Error in Authenticator.pre_spawn_start: DockerException Error while fetching server API version: (‘Connection aborted.’, FileNotFoundError(2, ‘No such file or directory’))
Are you sure docker is running on your system? You can get that error when compose is not able to connect to docker via docker socket (if any other way for connection is not defined).
Ok, so let me get this straight: if I do not want to do proper auth, and I do not want to create new Unix users for each visit to the page - that is, I want to use dummy authenticator - then I should actually install
docker, even if I don’t need it for anything else?!
Is there any other way to run dummy authenticator, without having to install docker, or any other extra software?