镜像问题:https ://unix.stackexchange.com/questions/217300/where-how-is-user-group-information-stored-in-ubuntu 。(得到答案后我会删除其中一个)
可能有两个地方:/etc/group和/etc/passwd。
如果我使用 command: adduser [username] [groupname]
,那么用户将被添加到组中,然后文件/etc/group
将被更新。
但是,该文件/etc/passwd
未更新。如果我通过命令检查我属于哪个组groups
,我只能看到passwd
文件中说明的组。因此,不会根据此结果将用户添加到组中。
我很困惑。
- storying group info into
/etc/passwd
, 和/etc/group
分别是什么意思? - 为什么
adduser
只更新group
文件? - 如何
passwd
通过命令将组添加到文件中? - 为什么
groups
从文件返回组信息passwd
,而不是group
文件?
谢谢。