首先:添加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
本文详细介绍了如何使用 OpenLDAP 添加组织单元 (OU) 和用户。首先通过 LDAP 命令行工具添加一个名为 Users 的组织单元,然后创建一个示例用户 tian,并设置了用户的各项属性。
1478

被折叠的 条评论
为什么被折叠?



