In a laboratory atmosphere, lots of new individuals will certainly be using JupyterHub. The default Authenticator of JupyterHub enables just the Linux system customers to visit to JupyterHub. So, if you want to create a brand-new JupyterHub user, you will need to create a brand-new Linux customer. Developing brand-new Linux individuals by hand might be a great deal of trouble for you. Rather, you can configure JupyterHub to make use of FirstUseAuthenticator. FirstUseAuthenticator as the name states, automatically creates a new user while visiting to JupyterHub for the very first time. After the customer is created, the same username and password can be used to visit to JupyterHub.
In this write-up, I am mosting likely to reveal you how to set up the JupyterHub FirstUseAuthenticator on the JupyterHub Python digital atmosphere. I am also going to show you exactly how to set up JupyterHub to utilize the FirstUseAuthenticator.
KEEP IN MIND: If you do not have JupyterHub installed on your computer, you can review one of the articles relying on the Linux circulation you’re using:
- Just how to Set Up the current Variation of JupyterHub on Ubuntu 22 04 LTS/ Debian 12/ Linux Mint 21
- Just how to Install the current Variation of JupyterHub on Fedora 38 +/ RHEL 9/ Rocky Linux 9
Tabulation:
- Producing a Team for JupyterHub Users
- Setting Up JupyterHub FirstUseAuthenticator on the JupyterHub Virtual Setting
- Setting Up JupyterHub FirstUseAuthenticator
- Rebooting the JupyterHub Solution
- Confirming if JupyterHub FirstUseAuthenticator is Working
- Producing New JupyterHub Users making use of JupyterHub FirstUseAuthenticator
- Verdict
- References
Producing a Group for JupyterHub Users:
I intend to maintain all the brand-new JupyterHub individuals in a Linux team jupyterhub-users for less complicated management.
You can create a brand-new Linux group jupyterhub-users with the following command:
$ sudo groupadd jupyterhub-users
Installing JupyterHub FirstUseAuthenticator on the JupyterHub Virtual Setting:
If you have actually followed my JupyterHub Setup Overview to install JupyterHub on your preferred Linux circulations (Debian-based and RPM-based), you can mount the JupyterHub FirstUseAuthenticator on the JupyterHub Python virtual setting with the complying with command:
$ sudo/ opt/jupyterhub/bin/ python 3 -m pip install jupyterhub-firstuseauthenticator
The JupyterHub FirstUseAuthenticator must be mounted on the JupyterHub digital environment.
Setting Up JupyterHub FirstUseAuthenticator:
To set up the JupyterHub FirstUseAuthenticator, open the JupyterHub configuration data jupyterhub_config. py with the nano full-screen editor as adheres to:
$ sudo nano/ opt/jupyterhub/etc/ jupyterhub/jupyterhub _ config.py
Key in the adhering to lines in the jupyterhub_config. py setup documents.
from jupyterhub. auth import LocalAuthenticator
from firstuseauthenticator import FirstUseAuthenticator
LocalAuthenticator. create_system_users = True
LocalAuthenticator. add_user_cmd = [‘useradd’, ‘–create-home’, ‘–gid’, ‘jupyterhub_users’ , ‘–shell’, ‘/bin/bash’]
FirstUseAuthenticator. dbm_path = / opt/jupyterhub/etc/ jupyterhub/passwords. dbm’
FirstUseAuthenticator. create_users = True
course LocalNativeAuthenticator ( FirstUseAuthenticator , LocalAuthenticator :
pass
c. JupyterHub authenticator_class = LocalNativeAuthenticator
As soon as you’re done, press
Rebooting the JupyterHub Service:
For the modifications to work, reboot the JupyterHub systemd service with the following command:
$ sudo systemctl reboot jupyterhub.service
If the JupyterHub configuration file has no errors, the JupyterHub systemd service ought to run just great.
Verifying if JupyterHub FirstUseAuthenticator is Working:
To verify whether the JupyterHub FirstUseAuthenticator is working, go to JupyterHub from your favorite web internet browser and try to visit as an arbitrary user with a brief and very easy password like 123, abc, etc.
You ought to see the marked error message that the password is also short and the password must be at the very least 7 characters long. It means that the JupyterHub FirstUseAuthenticator is working just fine.
Developing New JupyterHub Users making use of JupyterHub FirstUseAuthenticator:
To produce a new JupyterHub user using the FirstUseAuthenticator, see the JupyterHub login web page from a web browser, type in your preferred login username and the password that you intend to establish for the brand-new individual, and click on Sign in
A new JupyterHub user must be developed and your desired password should be set for the new customer.
When the brand-new customer is created, the freshly produced user must be logged into his/her JupyterHub account.
The following time you try to log in as the same customer with a different password, you will see the mistake Invalid username or password So, as soon as a customer is produced making use of the FirstUseAuthenticator, only that individual can log in with the exact same username and password combination. Nobody else can change this user account.
Verdict:
In this short article, I have revealed you exactly how to install the JupyterHub FirstUseAuthenticator on the JupyterHub Python online atmosphere. I have actually also shown you just how to set up JupyterHub to utilize the FirstUseAuthenticator.