You are not logged in.

#1 2009-06-24 00:14:59

nonis
Member
Registered: 2009-05-20
Posts: 43

output of 'groups' and 'groups username' dont match

I am having some problems with audio devices and cd rom devices all of the sudden. I think I messed up my groups by trying to add myself to disk and a group I created called windows. Now when I type 'groups' in console as the user 'nonis', I get the output

disk nonis windows

.
I should be in many more groups. I have looked through /etc/group and it has nonis in other groups including audio and optical. If I type 'groups nonis' as the user nonis or root, I get:

video audio optical storage power hal disk windows

Shouldn't these to outputs be the same? I believe they were the same until I added nonis to disk and windows. Even after, as root, I type 'usermod -aG video,audio,optical,storage,power,hal,disk,windows' I get the same output. I also have tried usermod without the -a option.

Why do I get two different lists of groups and what does the -a do?
Thanks.

Offline

#2 2009-06-24 00:16:29

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: output of 'groups' and 'groups username' dont match

man usermod

Offline

#3 2009-06-24 00:18:18

nonis
Member
Registered: 2009-05-20
Posts: 43

Re: output of 'groups' and 'groups username' dont match

I know that, but I don't really understand what supplimental groups are then.

Also, I have tried using -a and I still can't get 'groups' to output all of my groups.

Offline

#4 2009-06-24 00:39:46

nonis
Member
Registered: 2009-05-20
Posts: 43

Re: output of 'groups' and 'groups username' dont match

I think I fixed it. I logged out and back in as root (instead of just su). Then I found out that nonis's primary group had been changed to windows. I must've done this by accident. So I changed that. Then I added nonis to all the groups that I wanted from scratch with just -G. Now the two outputs match and are correct.

Why would the primary group affect what groups the user is displayed as being in. I don't really know what the primary vs supplimentary groups are.

Offline

#5 2009-06-24 00:45:19

Arisna
Member
Registered: 2009-02-13
Posts: 81

Re: output of 'groups' and 'groups username' dont match

If you want a different angle of approach, look into the gpasswd command for adding users to groups "politely."  For what it's worth, I had never heard of the groups command until this thread, and I used to make out okay manually editing /etc/group with vim. tongue

Anyway, do you still have privileges for all appropriate groups, output of "groups" aside?  I wonder if you're running into interesting things because of inconsistencies between /etc/group and /etc/gshadow.

Edit:  Whoops nonis, I didn't see your last post above this one before I posted.

Last edited by Arisna (2009-06-24 00:51:22)

Offline

#6 2009-06-24 00:48:13

nonis
Member
Registered: 2009-05-20
Posts: 43

Re: output of 'groups' and 'groups username' dont match

Now everything is fine, but before when the groups output was inconsistent I had problems with audio (alsamixer couldn't find a device, volwheel didn't work) and i couldn't get a media player to find the cdrom.

Offline

#7 2009-06-24 04:09:51

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: output of 'groups' and 'groups username' dont match

nonis wrote:

I know that, but I don't really understand what supplimental groups are then.

Also, I have tried using -a and I still can't get 'groups' to output all of my groups.

'primary group' is just what it says - it is your primary group and all files created by you will belong to that group.
'supplemental groups' are those you can give a user so he has access to certain facilities belonging to that group.

ie if you create a file, it will belong to your primary group, but no-one else will be allowed to (say) change that file unless they also belong to the same group as your primary group.
However, these things can be changed by appropriate 'umask' and 'chmod' commands.

Offline

Board footer

Powered by FluxBB