Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to integrate with OpenLDAP services in JupyterHub.

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to integrate with OpenLDAP services in JupyterHub. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

1. Purpose of document writing

JupyterHub users are based on OS system users by default, and the management and maintenance of users need to be operated on the server, which is not easy to manage. The editor mainly introduces how to integrate with OpenLDAP services in JupyterHub.

Test environment

1.CM5.15.0 and CDH version 5.14.2

2.JupyterHub version is 0.9.2

3.Python version 3.6.5

Precondition

1.JupyterHub has been deployed successfully

Integration of 2.JupyterHub and OpenLDAP

Only the default authentication method of operating system PAM is supported in JupyterHub by default. If you need JupyterHub to support OpenLDAP authentication, you need to install the plug-in for OpenLDAP authentication. Plug-in address: https://github.com/jupyterhub/ldapauthenticator

1. Install the jupyterhub-ldapauthenticator package in the Python3 environment with the following command:

[root@cdh03 ~] # / opt/cloudera/anaconda3/bin/pip install jupyterhub-ldapauthenticator

(can slide left and right)

Verify that the installation is successful after the installation is complete

[root@cdh03 ~] # / opt/cloudera/anaconda3/bin/pip show jupyterhub-ldapauthenticator

(can slide left and right)

two。 Modify the / etc/jupyterhub/jupyterhub_config.py file to add the OpenLDAP configuration, and add the following by default in the file:

# specify JupyterHub authentication type

C.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'

# OpenLDAP service address

C.LDAPAuthenticator.server_address = 'ldap://cdh01.fayson.com'

# access the DN of users and groups

C.LDAPAuthenticator.bind_dn_template = [

"uid= {username}, ou=People,dc=fayson,dc=com"

"uid= {username}, ou=Group,dc=fayson,dc=com"

]

(can slide left and right)

3. Start the Jupyterhub service

[root@cdh03 jupyterhub] # / opt/cloudera/anaconda3/bin/jupyterhub-f / etc/jupyterhub/jupyterhub_config.py-- debug

(can slide left and right)

If the startup is successful as shown above, add the-debug parameter after the startup command to display the DEBUG log, and-f specifies the configuration file loaded by JupyterHub startup.

3. Integrated verification

1. Create a testldap test user on OpenLDAP

two。 Enter http://cdh03.fayson.com:8000 in the browser to access JupyterHub and log in using the testldap user

Login succeeded

Open a Notebook and run the pyspark code for a test

View jobs on Yarn

4. Summary

1.JupyterHub integration with OpenLDAP requires the installation of the jupyterhub-ldapauthenticator plug-in.

two。 You can configure Group to restrict access to JupyterHub user groups.

About how to integrate with OpenLDAP services in JupyterHub. So much for sharing here. I hope the above content can help you to some extent and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report