mirror question: https://unix.stackexchange.com/questions/217300/where-how-is-user-group-information-stored-in-ubuntu. (i'll remove 1 of them after got answer)
two places possible: /etc/group , /etc/passwd.
if use command: adduser [username] [groupname], user added group, , file /etc/group updated.
however, file /etc/passwd not updated. if check group belongs to, via groups command, can see groups stated in passwd file.. therefore, user not added group base on result.
i'm confused.
- what's meaning of storying group info
/etc/passwd, ,/etc/grouprespectively? - why
adduserupdategroupfile? - how add group
passwdfile via command? - why
groupsreturn group infopasswdfile, notgroupfile?
thanks.
- in these traditional text files (there other ways, e.g. ldap), primary group goes
/etc/passwd(it's e.g. used permissions of files create), additional groups go/etc/group. - see 1.
- that's impossible, can change primary group
usermod -g - that's misinterpretation,
groupsshows all groups. new group picked when start new session (new login). can usenewgrpcommand, starts session given group name primary group (you must member of group) -- side effect, consult user database , update groups list.
Comments
Post a Comment