Categories
Linux

Ubuntu : Add user to a new group, existing group, group creation

In Ubuntu the linux commands to add an user to a new group, add user to an existing group, creating a new group etc.

To add a user to an existing group:

$ sudo adduser <USERNAME> <GROUPNAME>

To make a new group:

$ sudo addgroup <GROUPNAME>

See Which Groups Your Linux User Belongs To

$ groups <username>

If you don’t enter a username, it defaults to your own username. For instance:

$ groups

Remove a user from an existing group in Ubuntu

$ deluser <username> <groupname>