问题原文
原帖链接 · Thomas L Holaday · CC BY-SA 3.0
I want to verify that the user account filesender_1 is a member of the group valid_senders.
When I look at /etc/group, filesender_1 is not there:
valid_senders:x:12345:production_1
I read this as "production_1 is the only member of the group valid_senders, whose group id is 12345."
However:
When I look at /etc/passwd, the group id for valid_senders is listed for filesender_1 ...
filesender_1:x:1515:12345:filesender_1:/local/home/filesender_1:/bin/sh
... so I know valid_senders is the primary group for filesender_1.
Is this a surprising discrepancy, or is it normal for /etc/group to list only members where the group is secondary?
已采纳解答
原帖链接 · John · CC BY-SA 3.0
Yes, this discrepancy is normal. I've seen it so many times I stopped looking at the /etc/passwd and /etc/group files and instead started looking at group memberships the way they should be looked at: getent group <groupname> and groups <username>.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
