Re: ldapsearch cmdline question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


bruce wrote:

Trying to run a simple ldap search/query against a supposedly public ldap
server. I've tried a number of copy/paste attempts that I've seen from
various sites with no luck...

If anyone has successfully pinged/queried a public ldap server from the
cmdline, can you post your cmd that you used so I can see what I'm missing..

the site lists a number of public ldap servers.
i'm simply trying to figure out how to query/access the names from one of
the ldap servers.

as an example, i tried to use:
	ldapsearch -x -h -b "dc=bu,dc=edu" "(sn=tom*)"
	(but this generates a ldap_bind: protocol error...

however, if i do:
	ldapsearch -x -h -b "dc=stanford,dc=edu" "(sn=tom*)"
	ldapsearch -x -h -b "dc=usc,dc=edu" "(sn=tom*)"
	then i get back a list of data...

also, the for boston university, works on the website...

so, i'm sure i'm missing something simple, but i can't pin it down. any
help/pointers would be 'ppreciated!

my goal is to be able to understand how to query a public ldap server and to
be able to return different data elements.. (ie, name, given, first, or
See my response to David Timms.  Try "-P 2" on the command line.  Fedora
(and most distros) use newer LDAP clients that default to LDAP V3. The "" server is defaulting to LDAP V2 (and should be upgraded). The
"-P 2" option forces LDAP V2 protocol.

The "(sn=tom*)" is an LDAP filter.  Your second command essentially
means "find me any entries whose surnames start with 'tom' ('sn' means
'surname') in the tree starting at '' ('dc=stanford,dc=edu')
and return all attributes."  If you only want specific attributes
returned, then place them after the filter, separated by commas:

ldapsearch -x -h -b "dc=stanford,dc=edu" "(sn=tom*)" "gn,sn,cn,description"
- Rick Stevens, Systems Engineer                      [email protected] -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-   Errors have occurred. We won't tell you where or why.  We have   -
-                         lazy programmers.                          -

fedora-list mailing list
[email protected]
To unsubscribe:

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux