Docker搭建OpenLDAP+phpLDAPadmin统一用户认证
作者:互联网
Docker 搭建 LDAP
docker run -p 389:389 -p 636:636 --name my-openldap-container --env LDAP_ORGANISATION="ihopeit" --env LDAP_DOMAIN="ihopeit.com" --env LDAP_ADMIN_PASSWORD="admin_passwd_4_ldap" --detach osixia/openldap:1.4.0
Docker 搭建 phpLDAPadmin
docker run -p 80:80 -p 443:443 --name phpldapadmin-service --hostname phpldapadmin-service --link my-openldap-container --env PHPLDAPADMIN_LDAP_HOSTS=my-openldap-container --detach osixia/phpldapadmin:0.9.0
访问
https://ip
查询账户
docker exec my-openldap-container ldapsearch -x -H ldap://localhost -b dc=ihopeit,dc=com -D "cn=admin,dc=ihopeit,dc=com" -w admin_passwd_4_ldap
[root@localhost ~]# docker exec my-openldap-container ldapsearch -x -H ldap://localhost -b dc=ihopeit,dc=com -D "cn=admin,dc=ihopeit,dc=com" -w admin_passwd_4_ldap
# extended LDIF
#
# LDAPv3
# base <dc=ihopeit,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# ihopeit.com
dn: dc=ihopeit,dc=com
objectClass: top
objectClass: dcObject
objectClass: organization
o: ihopeit
dc: ihopeit
# admin, ihopeit.com
dn: cn=admin,dc=ihopeit,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword:: e1NTSEF9VXFlYkNzZUhDSmY3cW9Jbm9ISHFiVDFhQ3VxU2g0VGY=
# ducheng, admin, ihopeit.com
dn: uid=ducheng,cn=admin,dc=ihopeit,dc=com
objectClass: posixAccount
objectClass: top
objectClass: inetOrgPerson
gidNumber: 0
givenName: du
sn: cheng
displayName: ducheng
uid: ducheng
homeDirectory: cn=admin
cn: ducheng
uidNumber: 8528
# search result
search: 2
result: 0 Success
# numResponses: 4
# numEntries: 3
登录账户
DN: cn=admin,dc=ihopeit,dc=com
PASSWORD: admin_passwd_4_ldap
OpenLDAP文章
标签:ihopeit,cn,admin,phpLDAPadmin,dc,--,OpenLDAP,Docker,com 来源: https://blog.csdn.net/qq_42517220/article/details/121239530