dn: cn=Michael,ou=users,dc=example,dc=com objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson cn: Michael sn: MBC displayName: Michael MBC mail: michael@example.com userPassword: {SSHA}5rMM/3f8Ki13IyarGTtwzieoTu7KMgwc
$ cat rfc2307_config.yaml kind: LDAPSyncConfig apiVersion: v1 url: ldap://192.168.0.2:389 insecure: true rfc2307: groupsQuery: baseDN: "ou=groups,dc=example,dc=com" scope: sub derefAliases: never filter: (objectclass=groupOfNames) groupUIDAttribute: dn groupNameAttributes: [ cn ] groupMembershipAttributes: [ member ] usersQuery: baseDN: "ou=users,dc=example,dc=com" scope: sub derefAliases: never pageSize: 0 userUIDAttribute: dn userNameAttributes: [ dn ] tolerateMemberNotFoundErrors: true tolerateMemberOutOfScopeErrors: true
执行同步
1
oc adm groups sync --sync-config=rfc2307_config.yaml --confirm
结果展示
1 2 3 4 5 6 7
[root@allinone ~]# oc get group NAME USERS admins cn=Michael,ou=users,dc=example,dc=com [root@allinone ~]# [root@allinone ~]# oc get user NAME UID FULL NAME IDENTITIES cn=Michael,ou=users,dc=example,dc=com bf612e04-b592-11e8-8841-5254501db2dc Michael my_ldap_provider:cn=Michael,ou=users,dc=example,dc=com