I enabled memberof module in openldap. Added two groups and some members under them. (groupOfNames)
When I printed the members of a particular group using the filter (&(objectClass=groupOfNames)(cn=bowlers))
, it prints only the first member of the group though it has got multiple members.
How to list all members of a group?
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# example.com
dn: dc=example,dc=com
objectClass: top
objectClass: dcObject
objectClass: organization
o: Sierraware
dc: example
# admin, example.com
dn: cn=admin,dc=example,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword:: e1NTSEF9NFZXYit2MlVBS2xRVUdBOWVjK2IrSHBac3VpYnV6ZlM=
# People, example.com
dn: ou=People,dc=example,dc=com
objectClass: organizationalUnit
objectClass: top
ou: People
# Groups, example.com
dn: ou=Groups,dc=example,dc=com
objectClass: organizationalUnit
objectClass: top
ou: Groups
# adam, People, example.com
dn: uid=adam,ou=People,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: adam
sn: hanks
givenName: adam
cn: Adam hanks
displayName: Adam hanks
uidNumber: 10000
gidNumber: 5000
userPassword:: YWRhbWxkYXA=
gecos: Adam hanks
loginShell: /bin/bash
homeDirectory: /home/adam
# john, People, example.com
dn: uid=john,ou=People,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: john
sn: doe
givenName:: am9obiA=
cn: John Doe
displayName: John Doe
uidNumber: 10000
gidNumber: 5000
userPassword:: am9obmxkYXA=
gecos: John Doe
loginShell: /bin/bash
homeDirectory: /home/john
# wahab, People, example.com
dn: uid=wahab,ou=People,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: wahab
sn: riyaz
givenName:: d2FoYWIg
cn: Wahab Riaz
displayName: Wahab Riaz
uidNumber: 10008
gidNumber: 5008
userPassword:: d2FoYWJsZGFw
gecos:: V2FoYWIgUmlheiA=
loginShell: /bin/bash
homeDirectory: /home/wahab
# sachin, People, example.com
dn: uid=sachin,ou=People,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: sachin
sn: ramesh
givenName:: c2FjaGluIA==
cn: Sachin Ramesh
displayName: Sachin Ramesh
uidNumber: 10009
gidNumber: 5009
userPassword:: c2FjaGlubGRhcA==
gecos:: U2FjaGluIFJhbWVzaCA=
loginShell: /bin/bash
homeDirectory: /home/sachin
# bowlers, People, example.com
dn: cn=bowlers,ou=People,dc=example,dc=com
objectClass: groupOfNames
cn: bowlers
description: IT security group
member: cn=wahab,ou=People,dc=example,dc=com
member: cn=sachin,ou=People,dc=example,dc=com