docker-openldap icon indicating copy to clipboard operation
docker-openldap copied to clipboard

ldapsearch ldap_bind: Invalid credentils (46)

Open farous opened this issue 4 years ago • 1 comments

Hi,

I'm trying to ldapsearch from host to a container but it's not working. I saw 2 issues like mine but none of the solutions worked for me.

I start with :

docker run --env LDAP_ORGANISATION="OpenLdap" --env LDAP_DOMAIN="example.org" --env LDAP_ADMIN_PASSWORD="admin" -p 389:389 -p 636:636 --name openldap --detach osixia/openldap:1.5.0

Then this works :

docker exec openldap ldapsearch -x -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin

extended LDIF

LDAPv3

base <dc=example,dc=org> with scope subtree

filter: (objectclass=*)

requesting: ALL

example.org

dn: dc=example,dc=org objectClass: top objectClass: dcObject objectClass: organization o: OpenLdap dc: example

search result

search: 2 result: 0 Success

numResponses: 2

numEntries: 1

but this doesn't when executed directly from the host : ldapsearch -x -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin Result : ldap_bind: Invalid credentials (49)

thank you very much for your help

farous avatar Jul 27 '21 17:07 farous

Have you tried it without -x? Like so:

ldapsearch -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin

oschlueter avatar Aug 03 '21 13:08 oschlueter