Adding yourself to a group - the easy way

Every day solutions to every day challenges. + Brilliant stuff

Moderators: b1o, jkerr82508

Forum rules
Please feel free to post your tip it does not have to be advanced. Also ask questions directly related to the tip here. But do not start new threads with questions or ask for help here. That is what the help section is for. forum rules: http://bjoernvold.com/forum/viewtopic.php?f=8&t=568
User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Adding yourself to a group - the easy way

Postby viking60 » 17 Mar 2014, 12:16

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
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

Return to “Tips & Tricks”