You're not always going to be sitting at your physical server, or you want to run it headless, so you need to know how to administer your OpenLDAP server remotely.
All of the OpenLDAP commands use the same -H
option to connect to a remote host, like
this example for a local network that uses the server's
hostname:
# ldapsearch -H ldap://xena -xtb 'dc=alrac,dc=net'
Or, you may use the fully qualified domain name:
# ldapsearch -H ldap://xena.alrac.net -xtb 'dc=alrac,dc=net'
Or, specify the port. You don't need to do this unless you're using an alternate port:
# ldapsearch -H ldap://xena.alrac.net:389 -xtb 'dc=alrac,dc=net'
A lot of documentation still refers to using the lowercase
-h
, but this has been deprecated,
and someday will go away for good.
You don't have to use just the options in the example commands; any OpenLDAP command can be run remotely (e.g., searches, making changes, etc.).
man 1 ldapsearch
man 1 ldapmodify
OpenLDAP.org: http://www.openldap.org/
LDAP Directories Explained: An Introduction and Analysis, by Brian Arkills (Addison-Wesley)
LDAP System Administration, by Gerald Carter (O'Reilly)