I'm sure this is something simple, but I can't for the life of me figure out what is going on.

We are using NIS (haven't had a chance to migrate to LDAP) and for some reason the groups aren't being displayed correctly.

[scott.adair@tor-admin01 ~]$ groups

But when I search based on my username, it returns correctly

[scott.adair@tor-admin01 ~]$ groups scott.adair
scott.adair : pfa-admin it-admin

This is the same for the id command as well. This seems to work fine for local users (root), but not for any of my NIS accounts.

I can use the newgrp command to switch to the it-admin group, but that seems like a bit of hack.

Any ideas?

  • 1
    what does 'id' command show? both groups or only one? – Cougar Dec 12 '11 at 12:05
  • Shows only one, unless I specify the username then it shows both. – ScottAdair Dec 13 '11 at 0:59
  • 1
    Have you logged out and logged in after you added new groups? id+username takes these groups from /etc/group or NIS but just id gives you the current groups that were added when you logged in. – Cougar Dec 15 '11 at 19:07

I updated the /etc/nssiwtch.conf and changed

passwd:     compat
shadow:     compat
group:      compat


passwd:     files nis
shadow:     files nis
group:      files nis

Now all the groups are listed when I run the id or groups commands.

[scott.adair@tor-admin01 ~]$ id
uid=6100(scott.adair) gid=5000(pfa-admin) groups=5000(pfa-admin),5001(it-admin)

[scott.adair@tor-admin01 ~]$ groups
pfa-admin it-admin

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.