Ubuntu groups and user privileges - How I lost access to audio and automounting
Yesterday I tried to configure my users and group so that I could have a dir in /var/www/ that both I and apache could access. I make a group 'www' with the groupadd command, and added myself to it with 'usermod -G www myusername' After that, I couldn't play audio anymore through XMMS. It said I had no access or the audio was blocked.. Surprised, I figured it must have had something to do with the user/group things since that's all I'd changed. I went to user and groups in the administration panel and yes, there was the setting, "access to audio devices" was unchecked, as well as the 'automatic access to external storage devices'
As it turns out, I should have done 'adduser karin www' instead. The usermod command I used wiped me from other groups. Lucky for me I have three ubuntu installs so I can go and check what groups I should be in and what permissions I should have on another install where I didn't mess with the groups ;-)
Comments
usermod -a -G groupname
usermod -a -G groupname username
The -a option is critical. The user is added to group1 while he continues to be a member of other groups. If it’s not used, then the user is added only to group1 and removed from any other groups.