LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-26-2016, 08:51 AM   #1
achemete
LQ Newbie
 
Registered: May 2016
Posts: 3

Rep: Reputation: Disabled
id command is not showing secondary groups


During some days I've been working on a LDAP integration. Now, after configure almost everything that I needed, I came up with this last wall: The need of use secondary groups which are taken from the LDAP server.

**Behaviour:**

Code:
[root@sr-servicesLin ~]# id hmr
    uid=2956(hmr) gid=10000(ldapusers) groups=10000(ldapusers)

    [root@sr-servicesLin ~]# getent group repo
    repo:*:25958:
*Content of repo group (it's a LDAP group):*

Code:
 [root@sr-dns ~]# ldapsearch -x -H ldaps://ldap.eibind.iss -b "dc=eibind,dc=iss" "(&(objectclass=posixGroup)(cn=repo)(gidNumber=*))"
    # extended LDIF
    #
    # LDAPv3
    # base <dc=eibind,dc=iss> with scope subtree
    # filter: (&(objectclass=posixGroup)(cn=repo)(gidNumber=*))
    # requesting: ALL
    #
    
    # repo, Groups, eibind.iss
    dn: cn=repo,ou=Groups,dc=eibind,dc=iss
    objectClass: posixGroup
    objectClass: top
    cn: repo
    memberUid: hmr
    memberUid: jcontreras
    memberUid: hectoriss
    gidNumber: 25958
    
    # search result
    search: 2
    result: 0 Success

**The scenario:**


OS: Centos 6.7

*Packages:*
· ldap running with ssl
· sssd installed
· nss-pam-ldapd

The problem is:

When I use id command I'm not getting the secondary groups of every user, just the principal one (which comes from LDAP, so there is a connection).

I'm going to paste the main config files, I think that I put everything in the correct place. Surfing between sites, I read that is not recommended to have sssd and nsswitch configured at the same time, like configure ldap and sssfor "parse" all the desired data from the server, that it could be a mess for the server or something like that. Despite of this, I wrote ldap and sss as a data sources.

nsswitch.conf

Code:
#
    # /etc/nsswitch.conf
    #
   
    passwd:     files ldap sss
    shadow:     files ldap sss
    group:      files ldap sss
    
    #hosts:     db files nisplus nis dns
    hosts:      files dns
        
    bootparams: nisplus [NOTFOUND=return] files
    
    ethers:     files
    netmasks:   files
    networks:   files
    protocols:  files
    rpc:        files
    services:   files ldap sss
    
    netgroup:   files ldap sss
    
    publickey:  nisplus
    
    automount:  files ldap sss
    aliases:    files ldap nisplus
As you can see, I'm asking to ldap and sss (sssd) about the passwd, shadow and groups. Combined with this config, I also have the sssd.conf file, which is the following:

sssd.conf

Code:
[sssd]
    config_file_version = 2
    services = nss, pam, autofs
    domains = default
    
    [nss]
    filter_users = root,ldap,named,avahi,haldaemon,dbus,radiusd,news,nscd
    
    [pam]
    
    [domain/default]
    ldap_tls_reqcert = allow
    auth_provider = ldap
    ldap_schema = rfc2307bis
    krb5_realm = eibind.iss
    ldap_search_base = dc=eibind,dc=iss
    ldap_group_member = uniqueMember
    id_provider = ldap
    ldap_id_use_start_tls = True
    chpass_provider = ldap
    ldap_uri = ldaps://ldap.eibind.iss/
    
    #ldap_user_object_class = user
    #ldap_group_object_class = group
    
    #ldap_group_search_base = OU=Groups,DC=eibind,DC=iss
    #ldap_group_search_scope = one
    #ldap_group_object_class = group
    
    ldap_chpass_uri = ldaps://ldap.eibind.iss/
    krb5_kdcip = ldap.eibind.iss
    cache_credentials = True
    ldap_tls_cacertdir = /etc/openldap/cacerts
    entry_cache_timeout = 600
    ldap_network_timeout = 3
    krb5_server = ldap.eibind.iss
    autofs_provider = ldap
    [autofs]
Here we can see that I'm using ldap_schema = rfc2307bis and ldap_group_member = uniqueMember.

Also, there are some commented lines which I previously tried but without success.

To finish, I'm going to paste the nslcd.conf. In here I just followed this tutorial: https://arthurdejong.org/nss-pam-ldapd/setup , so my config file is as it comes plus these following lines:

Code:
# This comment prevents repeated auto-migration of settings.
    uri ldap://ldap.eibind.iss/
    base dc=eibind,dc=iss
    uid nslcd
    gid nslcd
I have to be missing something, some value, some stupid config. Probably I spend around 3-4 days looking at this, so any help with be very grateful.

Thanks in advance
 
Old 05-26-2016, 01:31 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
It has been a very long while... "ldap_group_search_scope = one" looks like it will only return one entry (and I think this is the default, but "base" may be). Might try specifying "subtree".

And I may be way off base.
 
Old 06-07-2016, 12:37 AM   #3
taiku
LQ Newbie
 
Registered: Jun 2016
Posts: 3

Rep: Reputation: Disabled
hi, I never use ldap_schema = rfc2307bis and ldap_group_member = uniqueMember in my sssd.conf file, however I am able to see the secondary groups using 'id <username>' command.

My nsswitch.conf file has these set:
passwd: files sss
shadow: files sss
group: files sss
services: files sss
netgroup: files sss

Also, you need to stop 'nslcd' service, as you are already running 'sssd'.

Here is my sssd.conf setting:

[domain/default]

ldap_id_use_start_tls = True
cache_credentials = True
ldap_search_base = dc=your,dc=domain
krb5_realm = EXAMPLE.COM
krb5_server = kerberos.example.com
id_provider = ldap
auth_provider = ldap
chpass_provider = ldap
ldap_uri = ldap://your.ldap.server
ldap_tls_cacertdir = /etc/openldap/cacerts
ldap_tls_reqcert = never

[sssd]
services = nss, pam
config_file_version = 2

domains = default
[nss]

[pam]

[sudo]

[autofs]

[ssh]

[pac]
 
Old 07-05-2016, 03:32 AM   #4
achemete
LQ Newbie
 
Registered: May 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hello guys,

I finally solved the problem.

HOW? Was really obvious and dumb by myself...


When we use "memberuid: $username", for groups which is RFC2307, it's not necessary at all specify rfc2307bis and uniqueMember.

So, the solution was delete those registries and taa-daa!

Thanks for your replies.
 
  


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
[SOLVED] SAMBA share - ACL's not recognizing secondary groups Mithrandir8 Linux - Server 2 05-10-2016 11:53 AM
primary & secondary groups ??? p_test Linux - General 2 09-12-2012 02:09 PM
sssd not returning secondary groups rhel 6.1 theonlyjason Linux - Enterprise 1 03-27-2012 06:16 PM
How many Secondary groups can user belong to on RHEL 5 server? sieben Linux - Server 0 02-03-2009 02:49 PM
Adding secondary groups thepurpleblob Linux - General 1 09-03-2003 10:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:32 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