Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OpenLDAP: 2.4.43
- I loaded the slapd.ldif config.
- $ sudo slapadd -F /etc/openldap/slapd.d -n 0 -l slapd.ldif
- Then loaded an admin and users with the file contents below ...
- $ sudo slapadd -F /etc/openldap/slapd.d -v -l 1 init.ldif
- --- init.ldif ---
- ## build the root node.
- dn: dc=my,dc=domain,dc=org
- objectClass: dcObject
- objectClass: organization
- dc: my domain
- o: domain
- dn: cn=manager,dc=my,dc=domain,dc=org
- objectClass: organizationalRole
- cn: admin
- description: LDAP Admin
- ## build the users ou.
- dn: ou=users,dc=my,dc=domain,dc=org
- ou: users
- objectClass: organizationalUnit
- description: domain users
- ## build the groups ou.
- dn: ou=groups,dc=my,dc=domain,dc=org
- ou: groups
- objectClass: organizationalUnit
- description: domain groups
- --- file end ---
- Started slapd.
- Tested with ...
- $ ldapsearch -x -b 'dc=my,dc=domain,dc=org' '(objectclass=*)'
- ... which returned the following ...
- ---- output ----
- # extended LDIF
- #
- # LDAPv3
- # base <dc=my,dc=domain,dc=org> with scope subtree
- # filter: (objectclass=*)
- # requesting: ALL
- #
- # my.domain.org
- dn: dc=my,dc=domain,dc=org
- dc: domain
- objectClass: dcObject
- objectClass: organization
- o: MyDomain
- # manager, my.domain.org
- dn: cn=manager,dc=my,dc=domain,dc=org
- objectClass: organizationalRole
- cn: admin
- description: LDAP Admin
- # users, my.domain.org
- dn: ou=users,dc=my,dc=domain,dc=org
- ou: users
- objectClass: organizationalUnit
- # groups, my.domain.org
- dn: ou=groups,dc=my,dc=domain,dc=org
- ou: groups
- objectClass: organizationalUnit
- # search result
- search: 2
- result: 0 Success
- # numResponses: 5
- # numEntries: 4
- ---- output end ----
- Stopped the slapd process.
- Loaded a user with this command, using the following ldif.
- $ sudo slapadd -F /etc/openldap/slapd.d -v -l james.ldif
- ---- james.ldif ---
- # user primary group
- dn: cn=james,ou=groups,dc=my,dc=domain,dc=org
- cn: james
- objectClass: top
- objectClass: posixGroup
- gidNumber: 1000
- # user account
- dn: uid=james,ou=users,dc=my,dc=domain,dc=org
- cn: James
- uid: james
- uidNumber: 1000
- gidNumber: 1000
- sn: James
- homeDirectory: /home/james
- mail: [email protected]
- objectClass: top
- objectClass: person
- objectClass: organizationalPerson
- objectClass: inetOrgPerson
- objectClass: posixAccount
- objectClass: shadowAccount
- loginShell: /bin/bash
- gecos: james
- userPassword: {crypt}x
- shadowLastChange: 0
- shadowMax: 0
- shadowWarning: 0
- ---- user file end ----
- Started slapd process again and performed the following search.
- # extended LDIF
Advertisement
Add Comment
Please, Sign In to add comment