LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Strange behavior / User missing from group file (https://www.linuxquestions.org/questions/linux-newbie-8/strange-behavior-user-missing-from-group-file-947792/)

funnyman 05-31-2012 10:57 AM

Strange behavior / User missing from group file
 
I'm new to *nix, though i have tried to learn the basics.

I have a cent os vps instance with plesk installed.

I have a user called joe which is, for some reason part of group psacln.

When i type
#id joe

this is the output i get
#uid=10001(joe) gid=2523(psacln) groups=2523(psacln)

but when i type
#getent group psacln

the system returns
#psacln:x:2523:


Why doesn't the user joe appear as part of group psacln although he is?

I have checked etc/group and joe doen't appear anywhere on the file. Joe is able to log in through SSH and browse the most of the server, including files with primary group Root.

What am i missing?

MensaWater 05-31-2012 01:10 PM

When you use id it is reading /etc/passwd and determining joe's default group ID (GID) from that file then getting the group name associated with that GID from /etc/group.

When you use getent group it is ONLY reading /etc/group so is only showing you people that have secondary group membership as they are the only ones that appear there.

See the difference between -g and -G in "useradd" and "usermod" commands by reviewing man pages for them.


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