Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Whenever I try to use ldapsearch with a -o option I get the following error:

Invalid general option name:

An example command I am trying to run (taken from redhat documentation):

ldapsearch -p 389 -h server.example.com -o "mech=GSSAPI" 
    -o "authid=dn:uid=jsmith,ou=people,dc=example,dc=com" 
    -o realm=EXAMPLE.COM

But it doesn't matter what option I try, I still get this error. I also made sure openldap was up to date on this computer.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Maybe the documentation is wrong...looking at the man page (version 2.4-Release), there're only two possible general options:

   -o opt[=optparam]

      Specify general options.

      General options:
        nettimeout=<timeout>  (in seconds, or "none" or "max")
        ldif-wrap=<width>     (in columns, or "no" for no wrapping)

That said, the man page has some related mentions, e.g.

   -E [!]ext[=extparam]
      Specify general extensions with -e and  search  extensions  with
      -E.  '!' indicates criticality.

      General extensions:
            [...]
    !authzid=<authzid>    ("dn:<dn>" or "u:<user>")
   [...]
   -O security-properties
      Specify SASL security properties.
   [...]
   -Y mech
      Specify the SASL mechanism to be  used  for  authentication.  If
      it's  not  specified, the program will choose the best mechanism
      the server knows.

so maybe one of these does the trick, just have a look at your ldapsearch's man page.

There's a reference on common errors with Kerberos, GSSAPI and SASL Authentication using LDAP that might be helpful once the correct options are picked.

share|improve this answer
add comment

Thank you for replying. I think your right, the doc is wrong or just outdated.

I did find all of the options I wanted by just doing a --help.

Just for completeness here is the command with all of the right options:

ldapsearch -p 389 -h server.example.com -X "authid=dn:uid=jsmith,ou=people,dc=example,dc=com" -R realm=EXAMPLE.COM -Y GSSAPI

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.