Authenticate Jupyterhub with a MySQL user database
Run this command to install:
pip install sqlauthenticator
In your jupyter_config.py
file, add or modify the following line to set the authentication method:
c.JupyterHub.authenticator_class = 'sqlauthenticator.SQLAuthenticator'
Additionally, set the following environment variables to point to your MySQL users database:
MYSQL_HOST
- MySQL Server hostnameMYSQL_PORT
- MySQL Server portMYSQL_DB
- MySQL Database nameMYSQL_USER
- MySQL UsernameMYSQL_PASS
- MySQL Password
The database defined in MYSQL_DB
should have a table called users
which has columns username
and password
.
username
should contain the plaintext username to be used by Jupyterhubpassword
should contain the user password hashed with the PBKDF2 hashing scheme.