首先:添加ou节点:
dn: cn=users,dc=example,dc=com
cn: users
description: Users of example.com
objectClass: organizationalRole
/usr/local/openldap/bin/ldapadd –x -D "uid=root,ou=people,dc=example,dc=com" -W -f /etc/openldap/openldap/ou.ldif
其次添加用户:
dn: cn=tian,cn=users,dc=example,dc=com
uid: tian
cn: Manager
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$1$IFm4FK.X$ozUsGze1DjCpPJdNErcwk.
shadowLastChange: 14484
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 0
gidNumber: 0
homeDirectory: /root
gecos: root
/usr/local/openldap/bin/ldapadd -D "uid=root,ou=people,dc=example,dc=com" -Y GSSAPI -f /etc/openldap/openldap/tian.ldif