Bash - add user to exiting group in Linux

2 points
Created by:

In this short article we want to show how in Linux, add user to exiting group using Bash (or any Command Line).

Quick solution:

sudo usermod -a -G group_name user_name

What will cause the user_name user will have attached additional group_name group.


  • in Linux each user is assignet to main group and additional groups,
  • run usermod command as super user.


  • -a means add operation,
  • -G means additional group.

Practical example

Type following command:

usermod -a -G sudo john


root@debian# groups john
john : john sudo

Note: we can see now john is assigned to sudo group too.

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.


Bash - add user to exiting group in Linux
Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂