Score:1

ldapsearch keeps failing even though the username/password supplied are correct

mx flag

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!

Jevgenij Martynenko avatar
us flag
Try using [email protected] as username. Also check server logs for login failure details
IT_User avatar
mx flag
@JevgenijMartynenko I changed -D to just be -D "username@domain" and successfully managed to get a valid query/response. Any thoughts on why the spelling out the full domain as I did wouldn't have worked?
Jevgenij Martynenko avatar
us flag
No idea. But my recommendation would be to avoid using username DN paths for system integrations as much as possible. It makes domain admins' lifes a lot easier if you use FQDN. This way they can rearrange structure of AD according to their needs without impacting application integrations
IT_User avatar
mx flag
@Jevgenij If you post that as an answer I will gladly accept. It solved my issue.
Score:1
cn flag

The DN is wrong. There is no Users OU. It should be cn=Users.

"cn=bind_user,ou=Users,dc=example,dc=domain,dc=com"

IT_User avatar
mx flag
I tried that change and it gave the same error as before.
cn flag
@IT_User: then the question should be corrected. It also shows the user DN in two locations, so there should only be one.
IT_User avatar
mx flag
I just updated the question to show that attempt as well now.
Score:1
us flag

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.