This is a discussion on Adding user to a third group seems to have removed him from one of the first two he was a member of??? within the Linux Security forums, part of the System Security and Security Related category; I had user mlh in two groups: mlh and accounting. mlh was the user's primary group. Then, I typed ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I had user mlh in two groups: mlh and accounting.
mlh was the user's primary group. Then, I typed usermod -G wheel mlh with the intention of adding mlh to a third group named wheel. Now, if I type groups mlh, only wheel and mlh are returned. The output from the groups command suggests that mlh is only a member of two groups now: wheel and mlh. Is that what happened? Did I bump mlh from the accounting group by virtue of having added him to wheel group this way? |
|
|||
|
>>>>> "MLH" == MLH <CRCI@NorthState.net> writes:
MLH> I had user mlh in two groups: mlh and accounting. mlh was the MLH> user's primary group. Then, I typed MLH> usermod -G wheel mlh usermod *sets* the (supplementary) groups that a user is part of. It does not *add* the group. In order to add to a group, you need to list the new group, along with all existing groups. (mlh is not removed from the mlh group because mlh is its initial group, which is set using -g.) The easiest way to add a user to a group is to use the adduser program, which is part of the adduser package. adduser <user> <group> will add the user <user> to the group <group>. (I like adduser for creating user accounts too.) -- Hubert Chan <hubert@uhoreg.ca> - http://www.uhoreg.ca/ PGP/GnuPG key: 1024D/124B61FA Fingerprint: 96C5 012F 5F74 A5F7 1FF7 5291 AF29 C719 124B 61FA Key available at wwwkeys.pgp.net. Encrypted e-mail preferred. |
|
|||
|
OK. I see. That makes sense. Thank-you.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx On Mon, 21 Mar 2005 23:09:19 -0500, Hubert Chan <hubert@uhoreg.ca> wrote: >>>>>> "MLH" == MLH <CRCI@NorthState.net> writes: > >MLH> I had user mlh in two groups: mlh and accounting. mlh was the >MLH> user's primary group. Then, I typed > >MLH> usermod -G wheel mlh > >usermod *sets* the (supplementary) groups that a user is part of. It >does not *add* the group. In order to add to a group, you need to list >the new group, along with all existing groups. (mlh is not removed from >the mlh group because mlh is its initial group, which is set using -g.) > >The easiest way to add a user to a group is to use the adduser program, >which is part of the adduser package. > > adduser <user> <group> > >will add the user <user> to the group <group>. (I like adduser for >creating user accounts too.) |
|
|||
|
>>>>> "Hubert" == Hubert Chan <hubert@uhoreg.ca> writes:
[...] Hubert> The easiest way to add a user to a group is to use the adduser Hubert> program, which is part of the adduser package. ^^^^^^^^^^^^^^^ [Head, meet palm] *smack* I thought I was reading a different newsgroup, and so I was thinking Debian. The usage of the adduser program, and the package that it's located in, may depend on your distribution. But it may be worth checking out anyways. -- Hubert Chan <hubert@uhoreg.ca> - http://www.uhoreg.ca/ PGP/GnuPG key: 1024D/124B61FA Fingerprint: 96C5 012F 5F74 A5F7 1FF7 5291 AF29 C719 124B 61FA Key available at wwwkeys.pgp.net. Encrypted e-mail preferred. |