Adding an attribute from the command line
Steps
-
Run the
ldapmodifytool from the command line interface. -
Specify the modification using the
changetype:modifysubcommand. -
Specify which attributes to add using the
addoption.Example:
In this example, we add another value for the
cnattribute, which is multi-valued.$ bin/ldapmodify -h server.example.com -p 389 -D "cn=admin,dc=example,dc=com" \ -w password dn: uid=user.2004,ou=People,dc=example,dc=com changetype: modify add: cn cn: Sally Tea Tree -
To process the request, enter
ctrl+dtwice.This is the UNIX EOF escape sequence.
An error might occur if the attribute is single-valued, if the value already exists, if the value does not meet the proper syntax, or if the value does not meet the entry’s
objectclassrequirements.Remove any trailing spaces after the attribute value.