Page 1 of 1

Adding yourself to a group - the easy way

Posted: 17 Mar 2014, 12:16
by viking60
Adding a user to a group can be done with usermod in combination with -G or -g or...
Like this

Code: Select all

usermod -G groupname username


Easy to forget that stuff (did the groupname orthe username come first and was it a capial G or a g...) so I tend to add myself to new groups by simply editing /etc/group

Code: Select all

sudo nano /etc/group

There all the groups are nicely listed and I put my name behind the one I need to be a part of.
before:

Code: Select all

audio:x:81:

after:

Code: Select all

audio:x:81:viking


The next time you log in you are the proud member of the audio group too +1
To check it simply type groups in a terminal

This works in Debian Mageia Manjaro etc...
Maybe it is Berserk style but it is way faster than finding it in "control centers" and to get that usermod command right.

Or maybe it is just a habit... It works though :-D