1, modify the configuration Harborp configuration file, a total of three changes
1.1 Auth_mode = Ldap_auth
1.2 Ldap_url = ldap://10.10.20.202
1.3 Ldap_basedn = uid=%s,dc=example,dc=com
2, implementation./prepare
3. Restart Harbor
Docker-compose stop
Docker-compose RM
Docker-compose up-d
"LDAP built through Docker"
1, create LDAP, new build_ldap.sh, content as follows, and execute
Name=Ldap_serverdockerRM-F $NAME2>/dev/NULLDocker Run--Envldap_organisation="Unitedstack Inc." --Envldap_domain="example.com" --Envldap_admin_password="123456" -P389:389 -P636:636 --detach--name $NAME Osixia/openldap:1.1.2
2, new user, new New_user.ldif, the content is as follows:
dn:uid=test,dc=example,dc=3/bin//home/ 1001 1001123456Mail: [Email protected]gecos:test
Create a new adduser.sh that reads as follows and executes
CP new_user.ldif ldap_server:/-"cn=admin,dc=example,dc=com" -W123456-f/new_user.ldif-zz
3, new is_user_exist.sh, see if the user exists, the content is as follows, and execute
Docker exec ldap_server ldapsearch-x-"cn=admin,dc=example,dc=com" -w 123456
Harbor Configuring LDAP