LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-03-2020, 11:23 AM   #1
mamillaSumanth
LQ Newbie
 
Registered: May 2019
Posts: 4

Rep: Reputation: Disabled
How to find user is part of how many group in OpenLDAP with ldapsearch query


Hello,

I want to get the name of groups to which users belongs in OpenLDAP.

As of now i could only find user details and group details individually.

[eedbuser@xxxx]$ ldapsearch -LLL -h xxxxxx -D uid=sai,ou=People,ou=xxxx,o=EEDIR -x -W -b o=EEDIR uid=sai
Enter LDAP Password:
dn: uid=sai,ou=People,ou=XXXXX,o=EEDIR
loginShell: /bin/bash
gidNumber: 55555
uid: sai
sn: sai
status: ACTIVE

If i want to find any group details i will use cn: GROUP NAME

But whati want here is when i search for user details at the same time i should get user info and user is part which groups also.
 
Old 02-03-2020, 11:30 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,797

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by mamillaSumanth View Post
Hello,
I want to get the name of groups to which users belongs in OpenLDAP. As of now i could only find user details and group details individually.

[eedbuser@xxxx]$ ldapsearch -LLL -h xxxxxx -D uid=sai,ou=People,ou=xxxx,o=EEDIR -x -W -b o=EEDIR uid=sai
Enter LDAP Password:
dn: uid=sai,ou=People,ou=XXXXX,o=EEDIR
loginShell: /bin/bash
gidNumber: 55555
uid: sai
sn: sai
status: ACTIVE

If i want to find any group details i will use cn: GROUP NAME But whati want here is when i search for user details at the same time i should get user info and user is part which groups also.
The man page for ldapsearch has much on this; please read the "Question Guidelines" link in my posting signature; basic research should be done before posting a question.

Putting
Code:
"(objectclass=*)" '*'
into your search string returns everything for a user.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ldapsearch vs Apache DS LDAP browser (ldapsearch not working properly) eyemole80 Linux - Server 0 02-18-2014 02:45 PM
User is a Part of a Group But Group Details Do Not Show the User devUnix Linux - Server 6 08-08-2013 07:02 AM
nss_ldap, openldap and openldap-server ... what is openldap for? chakkerz Linux - Server 2 08-13-2009 07:16 PM
Best scripting language for working with openldap-tools (ldapsearch, etc) kenneho Linux - Server 2 11-21-2008 01:31 AM
OpenLDAP, ldapsearch: how to list all attributes Hko Linux - Networking 0 08-15-2004 10:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration