11.4. Adding an IdM stage user directly from the CLI using ldapmodify
Follow this procedure to access access Identity Management (IdM) LDAP and use the ldapmodify utility to add a stage user.
Prerequisites
- The IdM administrator has created the provisionator account and a password for it. For details, see Preparing IdM accounts for automatic activation of stage user accounts.
- You as the external administrator know the password of the provisionator account.
- You can SSH to the IdM server from your LDAP server.
You are able to supply the minimal set of attributes that an IdM stage user must have to allow the correct processing of the user life cycle, namely:
-
The
distinguished name(dn) -
The
common name(cn) -
The
last name(sn) -
The
uid
-
The
Procedure
Use the
SSHprotocol to connect to the IdM server using your IdM identity and credentials:$ ssh provisionator@server.idm.example.com Password:Obtain the TGT of the provisionator account, an IdM user with a role to add new stage users:
$ kinit provisionatorEnter the
ldapmodifycommand and specify Generic Security Services API (GSSAPI) as the Simple Authentication and Security Layer (SASL) mechanism to use for authentication. Specify the name of the IdM server and the port:# ldapmodify -h server.idm.example.com -p 389 -Y GSSAPI SASL/GSSAPI authentication started SASL username: provisionator@IDM.EXAMPLE.COM SASL SSF: 56 SASL data security layer installed.Enter the
dnof the user you are adding:dn: uid=stageuser,cn=staged users,cn=accounts,cn=provisioning,dc=idm,dc=example,dc=comEnter add as the type of change you are performing:
changetype: addSpecify the LDAP object class categories required to allow the correct processing of the user life cycle:
objectClass: top objectClass: inetorgpersonYou can specify additional object classes.
Enter the
uidof the user:uid: stageuserEnter the
cnof the user:cn: Babs JensenEnter the last name of the user:
sn: JensenPress
Enteragain to confirm that this is the end of the entry:[Enter] adding new entry "uid=stageuser,cn=staged users,cn=accounts,cn=provisioning,dc=idm,dc=example,dc=com"- Exit the connection using Ctrl + C.
Verification
Verify the contents of the stage entry to make sure your provisioning system added all required POSIX attributes and the stage entry is ready to be activated.
To display the new stage user’s LDAP attributes, enter the
ipa stageuser-show --all --rawcommand:$ ipa stageuser-show stageuser --all --raw dn: uid=stageuser,cn=staged users,cn=accounts,cn=provisioning,dc=idm,dc=example,dc=com uid: stageuser sn: Jensen cn: Babs Jensen has_password: FALSE has_keytab: FALSE nsaccountlock: TRUE objectClass: top objectClass: inetorgperson objectClass: organizationalPerson objectClass: personNote that the user is explicitly disabled by the
nsaccountlockattribute.