Closed masedki closed 3 years ago
I guess you should use dockerspawner or systemdspawner. Especiallly the systemdspawner and I'm figuring it out.
import tmpauthenticator import systemdspawner c=get_config() c.JupyterHub.authenticator_class=tmpauthenticator.TmpAuthenticator c.JupyterHub.spawner_class=systemdspawner.SystemdSpawner c.SystemdSpawner.dynamic_users=True The config above works with root. But always keep reconnecting to the kernels......
I reinstalled jupyter notebook with root, and the reconnecting problem solved, nothing else to do.
Thank you very much, your help motivated me to relaunch this work that I left out, now I'm facing this.
My jupyterhub_config.py contains : import tmpauthenticator import systemdspawner c=get_config() c.JupyterHub.authenticator_class=tmpauthenticator.TmpAuthenticator c.JupyterHub.spawner_class=systemdspawner.SystemdSpawner
c.SystemdSpawner.dynamic_users=True
c.Authenticator.whitelist = {'sedki'} c.Authenticator.admin_users={'sedki'}
c.SystemdSpawner.disable_user_sudo = True
c.Spawner.cmd = '/home/sedki/anaconda3/bin/jupyterhub-singleuser'
c.Spawner.notebook_dir = '~/notebooks' c.JupyterHub.ssl_cert = '/home/sedki/mycert.pem' c.JupyterHub.ssl_key = '/home/sedki/mykey.key'
c.Spawner.http_timeout = 600 c.Spawner.start_timeout = 60 c.Spawner.cpu_guarantee = 0.5 c.Spawner.cpu_limit = 1 c.Spawner.mem_guarantee = '0.25G' c.Spawner.mem_limit = '1G'
c.JupyterHub.hub_ip = '10.91.136.225' c.JupyterHub.cookie_secret_file = '/home/sedki/jupyterhub_cookie_secret' c.JupyterHub.proxy_cmd = ['/usr/bin/configurable-http-proxy']
c.Spawner.notebook_dir = '~/notebooks'
In my case, the config above cause the spanwer could not work. So I just ask my students to git clone the class resources.
It may take a long time to study about systemd, when we can get the default user directory copy to the temp users' directory. I think you may try modifying '~/notebooks' to '/home/root/notebooks', and
'/home/sedki/mycert.pem' to '/home/root/mycert.pem'
'/home/sedki/mykey.key' to '/home/root/mykey.key'
'/home/sedki/jupyterhub_cookie_secret' to '/home/root/jupyterhub_cookie_secret'
root user may not have the permission to access native user's directory, some times.
At last, please ensure you can start up and successfully log in jupyter notebook and use the kernel you want, when you start your jupyter notebook with root.
c.Spawner.notebook_dir = '~/notebooks' In my case, the config above cause the spanwer could not work. So I just ask my students to git clone the class resources. It may take a long time to study about systemd, when we can get the default user directory copy to the temp users' directory. I think you may try modifying '~/notebooks' to '/home/root/notebooks', and '/home/sedki/mycert.pem' to '/home/root/mycert.pem' '/home/sedki/mykey.key' to '/home/root/mykey.key' '/home/sedki/jupyterhub_cookie_secret' to '/home/root/jupyterhub_cookie_secret' root user may not have the permission to access native user's directory, some times. At last, please ensure you can start up and successfully log in jupyter notebook and use the kernel you want, when you start your jupyter notebook with root.
Can I have a working dockerimage with tmpauthenticator enabled?
Hi there @masedki :wave:!
I closed this issue because it was labelled as a support question.
Please help us organize discussion by posting this on the http://discourse.jupyter.org/ forum.
Our goal is to sustain a positive experience for both users and developers. We use GitHub issues for specific discussions related to changing a repository's content, and let the forum be where we can more generally help and inspire each other.
Thanks you for being an active member of our community! :heart:
I am trying to deploy an environment on a server to run R notebook for students of France without authentication. I'm trying to use jupyterhub with tmpauthenticator but I'm having the following error.
KeyError: 'getpwnam(): name not found: 33e174f0-4792-415b-afd4-3ffdf8981524'
my jupyterhub_config.py file contains: import tmpauthenticator c.JupyterHub.authenticator_class = tmpauthenticator.TmpAuthenticator c.LocalAuthenticator.create_system_users = True c.PAMAuthenticator.open_sessions = False c.Spawner.cmd = '/usr/local/bin/jupyterhub-singleuser' c.Spawner.args = ['--allow-root','--no-browser'] c.Spawner.notebook_dir = '~/notebooks' c.JupyterHub.ssl_cert = 'mycert.pem' c.JupyterHub.ssl_key = 'mykey.key' c.JupyterHub.cookie_secret_file = '/home/juser/jupyterhub_cookie_secret' c.JupyterHub.proxy_cmd = ['/usr/local/bin/configurable-http-proxy']
is there some things wrong ?