Adding user to a third group seems to have removed him from one of the first two he was a member of???

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 ...


Go Back   Usenet Forums > System Security and Security Related > Linux Security

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-22-2005
MLH
 
Posts: n/a
Default Adding user to a third group seems to have removed him from one of the first two he was a member of???

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?
Reply With Quote
  #2 (permalink)  
Old 03-22-2005
Hubert Chan
 
Posts: n/a
Default Re: Adding user to a third group seems to have removed him from oneof the first two he was a member of???

>>>>> "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.
Reply With Quote
  #3 (permalink)  
Old 03-22-2005
MLH
 
Posts: n/a
Default Re: Adding user to a third group seems to have removed him from one of the first two he was a member of???

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.)


Reply With Quote
  #4 (permalink)  
Old 03-22-2005
Hubert Chan
 
Posts: n/a
Default Re: Adding user to a third group seems to have removed him from oneof the first two he was a member of???

>>>>> "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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 04:30 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0