ldapsearch Fails Despite Correct Username/Password

active-directoryldapldapsearch

Working to tie a server into ldap (active directory) and been struggling to get a simple bind working. The commands I have tried are:

ldapsearch -x -H ldap://192.168.10.10 -b "dc=example,dc=domain,dc=com" -D "cn=bind_user,dc=example,dc=domain,dc=com"-W
ldapsearch -x -H ldap://192.168.10.10 -b "dc=example,dc=domain,dc=com" -D "cn=bind_user,ou=Users,dc=example,dc=domain,dc=com" -W
ldapsearch -x -H ldap://192.168.10.10 -b "dc=example,dc=domain,dc=com" -D "cn=bind_user,cn=Users,dc=example,dc=domain,dc=com" -W

My LDAP server is active directory (windows 2016). My domain is example.domain.com. I do not believe I have anything special in my OU structure. Users live under the "Users" area like normal. Port 389 is opened via the firewall. Anonymous bind is blocked by default

Thoughts on why this simple bind would not be working? I have tried probably 20-ish flavors of the above with no luck.

The error I recieve is:

Enter LDAP Password:
ldap_bind: Invalid credentials (49)
    additional info: 80090308: LdapErr: DSID-0C09044E, comment: AcceptSecurityContext error, 
data 52e, v2580

Error tells me it is a bad credential or DN but can't see/comprehend what may be off. Thank you!

Best Answer

Try using [email protected] as username.

My recommendation would be to avoid using username DN paths for system integrations as much as possible. It makes domain admins' life a lot easier if you use FQDN. This way they can rearrange AD structure according to their needs without impacting application integrations