You are not logged in.

#1 2007-02-12 18:56:11

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

usermod strange behavior

So... I'm into Linux/Unix for some time, but I found something strange and I want to know if this happens only to me.
If I add a user to some group, automatically it removes the user from the other groups he belongs too.

For example, I had my username as member of audio,optic and wheel groups, but then I added it to the camera group and surprisingly I found out that I couldn't change the sound volume anymore because I wasn't in the audio group.

And here is the proof:

[root@kyle ~]# grep radu /etc/group
wheel::10:root,radu
video:x:91:radu
audio::92:radu
optical::93:hal,radu
power:x:98:radu
users::100:radu
slocate:x:21:radu
camera:x:97:radu
abs:x:102:radu

[root@kyle ~]# usermod -G bin radu

[root@kyle ~]# grep radu /etc/group
bin::1:root,bin,daemon,radu

Why does this happen? AFAIK 'usermod -G' adds the user to a group, but doesn't have to remove it from other groups.

Offline

#2 2007-02-12 20:22:28

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: usermod strange behavior

you need to add -a

manpage wrote:

-a, --append
          Add the user to the supplemental group(s). Use only with -G option.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2007-02-12 21:01:44

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: usermod strange behavior

this is weird. it's the first time I see this... anyway, thanks!

Offline

Board footer

Powered by FluxBB