1

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!

IT_User
  • 211
  • 1
  • 2
  • 15
  • 1
    Try using user@fqdn.domain as username. Also check server logs for login failure details – J-M Nov 14 '21 at 07:19
  • @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? – IT_User Nov 15 '21 at 17:46
  • 1
    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 – J-M Nov 15 '21 at 18:45
  • 1
    @Jevgenij If you post that as an answer I will gladly accept. It solved my issue. – IT_User Nov 18 '21 at 02:39

2 Answers2

2

Try using user@fqdn.domain 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

J-M
  • 1,492
  • 1
  • 9
  • 16
1

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"

Greg Askew
  • 34,339
  • 3
  • 52
  • 81