This procedure describes how to extend the native LDAP schema and populate the user and group objects with the associated Windows names.
For sample LDIF file contents, see Example 2–3.
$ ldapmodify -D cn=admin -w p -f input-file
You can use the idmap set-namemap command to populate user and group objects. See How to Add a Directory-Based Name Mapping to a User or Group Object.
See the sample LDIF file in Example 2–4. For more information about the LDIF file format, see RFC 2849.
$ ldapmodify -h LDAP-server-name -o mech=gssapi -o authzid='' -f input-file
This example shows a sample LDIF file, nldap_namemap_schema.ldif, that describes the native LDAP schema changes:
dn: cn=schema changetype: modify add: attributeTypes attributeTypes: ( 1.3.6.1.4.1.42.2.27.5.1.62 NAME 'winAccountName' DESC 'Windows user or group name corresponding to a Unix user or group' EQUALITY caseIgnoreMatch SUBSTRINGS caseIgnoreSubstringsMatch ORDERING caseIgnoreOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) - add: objectClasses objectClasses: ( 1.3.6.1.4.1.42.2.27.5.2.16 NAME 'winAccount' DESC 'Auxiliary class to store Windows name mappings in Unix user/group objects' SUP top AUXILIARY MAY winAccountName )
Load the schema changes into native LDAP:
$ ldapmodify -D cn=admin -w - -f nldap_namemap_schema.ldif Enter bind password: modifying entry cn=schemaExample 2-4 Populating Native LDAP User and Group Objects
The following example has Oracle Solaris users tmw, crj, and dab stored in native LDAP. These Oracle Solaris users are associated with the Windows users john, george, and mary, respectively, all in the domain example.com.
This example shows how to add the Windows user names to the appropriate user objects in native LDAP by using the ldapmodify command.
First, create an input file, updateUsers, that associates the Oracle Solaris names with the Windows names:
$ cat updateUsers dn: uid=tmw,ou=passwd,dc=example,dc=com changetype: modify add: winAccountName winAccountName: [email protected] dn: uid=crj,ou=passwd,dc=example,dc=com changetype: modify add: winAccountame winAccountame: [email protected] dn: uid=dab,ou=passwd,dc=example,dc=com changetype: modify add: winAccountame winAccountame: [email protected] $
Then, run the ldapmodify command to update the user objects on the native LDAP server, neptune:
$ ldapmodify -h neptune -o mech=gssapi -o authzid='' -f updateUsers