LDAP-UX Client Services B.05.01 Administrator Guide for HP directory servers and Windows ADS
7.8.2 Modifying a host
Use the -m option of ldaphostmgr to modify existing host entries. If neither -a, -m, nor -g is
specified, -m is assumed. In the -a and -m modes, ldaphostmgr can be used to add, change,
or remove arbitrary attributes. You can manage some attributes using ldaphostmgr command-line
options; for example, use -k to manage the hostâs ssh public key, and -i to manage the hostâs IP
address. You can add arbitrary attributes using the -A or -R options, or by adding an attribute
and value list to the end of the command line. The following example shows how to assign a âroleâ
to a host:
# ldaphostmgr -m -r WEBSERVER -A objectclass=labeledURIObject \
-A "labeledUri=http://baker.mydomain.example.com" baker
bind-dn [uid=domadmin,ou=People,dc=mydomain,dc=example,dc=com]:
Password:
# ldaphostlist -n baker \*
dn: cn=baker,ou=Hosts,dc=mydomain,dc=example,dc=com
cn: baker
ipHostNumber: 16.89.146.146
objectClass: top
objectClass: device
objectClass: iphost
objectClass: domainEntity
objectClass: labeledURIObject
owner: uid=domadmin,ou=People,dc=mydomain,dc=example,dc=com
entityRole: WEBSERVER
labeledUri: http://baker.mydomain.example.com
Adding and removing attributes can be affected when these attributes are multivalued (meaning
one attribute type can contain multiple instances, with different values). Managing multivalued
attributes is handled differently for arbitrary attributes as opposed to attributes managed by
command-line options (like -r in the previous example). For example, using -r replaces all existing
values of the entityRole attribute. Refer to the ldaphostmgr(1M) manpage for additional
information for each usage scheme. IP addresses are stored in the ipHostNumber attribute, and
managed with the -i option. Additional details on how to manage IP addresses are described in
Section 7.8.4 (page 238).
7.8.3 Deleting a host
Use the -d option of ldaphostmgr to remove a host from the directory server. This removes the
entire entry from the directory server. To only remove specific attributes from an entry, see the -R
option in the ldaphostmgr(1M) manpage. The following example shows how to remove a host
entry:
# ldaphostlist entityRole
dn: cn=brewer,ou=Hosts,dc=mydomain,dc=example,dc=com
cn: brewer
ipHostNumber: 16.92.96.116
dn: cn=baker,ou=Hosts,dc=mydomain,dc=example,dc=com
cn: baker
ipHostNumber: 16.89.146.146
entityRole: WEBSERVER
dn: cn=chef,ou=Hosts,dc=mydomain,dc=example,dc=com
cn: chef
ipHostNumber: 0.0.0.0
# ldaphostmgr -d chef
bind-dn [uid=domadmin,ou=People,dc=mydomain,dc=example,dc=com]:
Password:
# ldaphostlist
dn: cn=brewer,ou=Hosts,dc=mydomain,dc=example,dc=com
cn: brewer
7.8 Managing hosts in an LDAP-UX domain 237