110 lines
2.5 KiB
Plaintext
110 lines
2.5 KiB
Plaintext
# LDAP初始化数据文件
|
|
# 用于创建基本的组织单位、用户和组
|
|
|
|
# 创建组织单位 - 用户
|
|
dn: ou=people,dc=example,dc=com
|
|
objectClass: organizationalUnit
|
|
ou: people
|
|
description: 用户组织单位
|
|
|
|
# 创建组织单位 - 组
|
|
dn: ou=groups,dc=example,dc=com
|
|
objectClass: organizationalUnit
|
|
ou: groups
|
|
description: 组织单位
|
|
|
|
# 创建管理员组
|
|
dn: cn=administrators,ou=groups,dc=example,dc=com
|
|
objectClass: groupOfNames
|
|
cn: administrators
|
|
description: 系统管理员组
|
|
member: cn=admin,dc=example,dc=com
|
|
|
|
# 创建开发者组
|
|
dn: cn=developers,ou=groups,dc=example,dc=com
|
|
objectClass: groupOfNames
|
|
cn: developers
|
|
description: 开发者组
|
|
member: cn=admin,dc=example,dc=com
|
|
|
|
# 创建测试用户1
|
|
dn: uid=john.doe,ou=people,dc=example,dc=com
|
|
objectClass: inetOrgPerson
|
|
objectClass: posixAccount
|
|
objectClass: shadowAccount
|
|
uid: john.doe
|
|
sn: Doe
|
|
givenName: John
|
|
cn: John Doe
|
|
displayName: John Doe
|
|
uidNumber: 1001
|
|
gidNumber: 1001
|
|
userPassword: password123
|
|
gecos: John Doe
|
|
loginShell: /bin/bash
|
|
homeDirectory: /home/john.doe
|
|
mail: john.doe@example.com
|
|
telephoneNumber: +1-555-0001
|
|
title: Senior Developer
|
|
departmentNumber: IT
|
|
description: Senior Software Developer
|
|
|
|
# 创建测试用户2
|
|
dn: uid=jane.smith,ou=people,dc=example,dc=com
|
|
objectClass: inetOrgPerson
|
|
objectClass: posixAccount
|
|
objectClass: shadowAccount
|
|
uid: jane.smith
|
|
sn: Smith
|
|
givenName: Jane
|
|
cn: Jane Smith
|
|
displayName: Jane Smith
|
|
uidNumber: 1002
|
|
gidNumber: 1002
|
|
userPassword: password123
|
|
gecos: Jane Smith
|
|
loginShell: /bin/bash
|
|
homeDirectory: /home/jane.smith
|
|
mail: jane.smith@example.com
|
|
telephoneNumber: +1-555-0002
|
|
title: Project Manager
|
|
departmentNumber: IT
|
|
description: IT Project Manager
|
|
|
|
# 创建测试用户3
|
|
dn: uid=bob.wilson,ou=people,dc=example,dc=com
|
|
objectClass: inetOrgPerson
|
|
objectClass: posixAccount
|
|
objectClass: shadowAccount
|
|
uid: bob.wilson
|
|
sn: Wilson
|
|
givenName: Bob
|
|
cn: Bob Wilson
|
|
displayName: Bob Wilson
|
|
uidNumber: 1003
|
|
gidNumber: 1003
|
|
userPassword: password123
|
|
gecos: Bob Wilson
|
|
loginShell: /bin/bash
|
|
homeDirectory: /home/bob.wilson
|
|
mail: bob.wilson@example.com
|
|
telephoneNumber: +1-555-0003
|
|
title: DevOps Engineer
|
|
departmentNumber: IT
|
|
description: DevOps and Infrastructure Engineer
|
|
|
|
# 将用户添加到开发者组
|
|
dn: cn=developers,ou=groups,dc=example,dc=com
|
|
changetype: modify
|
|
add: member
|
|
member: uid=john.doe,ou=people,dc=example,dc=com
|
|
-
|
|
add: member
|
|
member: uid=bob.wilson,ou=people,dc=example,dc=com
|
|
|
|
# 将管理员用户添加到管理员组
|
|
dn: cn=administrators,ou=groups,dc=example,dc=com
|
|
changetype: modify
|
|
add: member
|
|
member: uid=jane.smith,ou=people,dc=example,dc=com
|