I have kept my LDAP password in $HOME/.ldap_pw
on my Mac. The file has permissions set to 600:
-rw------- 1 myself mygroup 18 Mar 27 17:20 .ldap_pw
When I invoke ldapsearch
with -y
option like this, to list the members of the group mygroup
ldapsearch -y "$HOME/.ldap_pw" -H ldaps://ldap.mycompany.com -D myself@mycompany.com -W -b DC=mycompany,DC=com -x '(&(objectcategory=Group)(cn=mygroup))'
I get this error:
ldap_bind: Invalid credentials (49)
additional info: 80090308: LdapErr: DSID-0C090442, comment: AcceptSecurityContext error, data 52e, v3839
The password stored in the file is correct. Also, the above command works fine when run without the -y
option with password being entered when prompted.
What is going wrong here?
I get the same error on my Linux box running RedHat 7.6.