NIS user not being added to NIS group

Posted by Brian on Server Fault See other posts from Server Fault or by Brian
Published on 2012-09-27T18:07:12Z Indexed on 2012/09/27 21:40 UTC
Read the original article Hit count: 443

Filed under:
|

I have set up a NIS server and several NIS clients. I have a user and a group on the NIS server like so:

/etc/passwd:  myself:x:5000:5000:,,,:/home/myself:/bin/bash
/etc/group:   fishy:x:3001:otheruser,etc,myself,moreppl

I imported the users and groups on the NIS client by adding +:::::: to /etc/passwd and +::: to /etc/group.

I can log in to the NIS client, but when I run groups, fishy is not listed. But getent group fishy shows that it was imported correctly and lists me as a member. And if I do sudo su - myself, then suddenly groups says I am in the group!

I also had nscd installed, and the groups worked correctly for a while. It seemed like after being logged in for a while, I would silently be dropped out of the group. If I restarted nscd and logged in again, then the groups worked correctly...for a while.

There are no UID or GID conflicts with local users or groups.

Update: Contents of /etc/nsswitch.conf:

passwd:         compat
group:          compat
shadow:         compat

hosts:          files nis dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
aliases:        nis files

© Server Fault or respective owner

Related posts about linux

Related posts about nis