At Mon, 1 Jun 2009 02:40:57 -0400, Sai wrote:
ldapsearch -x -h <Machine> -p <port> -s one -D <CN> -b <BASE_DN> -y pwdfile -v "(&(cn=fm*))" cn
The -D option takes DN, not CN.
I tried the following.
I tried putting the plaintext password for <CN> in the file and it
did not work.
If the pwdfile contains LF (\x0a) or others, strip it. OpenLDAP ldap* commands use the entire contents in a pwdfile. I think this is a bad design...
Try:
$ (umask 0077; echo -n "DN's password" >pwdfile) $
or:
$ tr -d '\n' <pwdfile \ |ldapsearch -x -h <Machine> -p <port> -s one -D <DN> -b <BASE_DN> -y /dev/stdin
IIRC, older OpenLDAP ldap* commands cannot use /dev/stdin for the -y option.