How to create a new user group and add user to it in Ubuntu 12.04

5,356

I have answers, but they involve using the command-line.

to set the primary group for a user, you can type

sudo usermod -g the_group_name  the_user_name

if you want your user to be member of multiple groups (audio, www, or any existing group) you can use

sudo usermod -G group1,group3,group3  the_user_name

Notice the '-G' (caps)

These command run as root (that's what the 'sudo' is for), so they will ask you to enter your password, but really, there is nothing scary here. Note that you cannot avoid being/becoming (at least temporarily) root to perform users/groups managements tasks under Linux.

Share:
5,356

Related videos on Youtube

Omal Lasitha
Author by

Omal Lasitha

Updated on September 18, 2022

Comments

  • Omal Lasitha
    Omal Lasitha over 1 year

    My OS is Ubuntu 12.04.1 Desktop version (32bit).

    I want to create a new group called restricted which allows its users to use Audio devices and Video devices only, and I want to add a user called visitors to that group.

    By using Users and Groups, I was able to create a new user account called visitors, and a new group called restricted. But I can't figure out how to add those settings to the group restricted, and add the visitors user account to that group.

    I tried Google-ing, but every search result was about accessing root privileges and all, and I couldn't find answers on this specific topic.