In this short article we want to show how in Linux, add user to exiting group using Bash (or any Command Line).
sudo usermod -a -G group_name user_name
What will cause the
user_name user will have attached additional
- in Linux each user is assignet to main group and additional groups,
usermodcommand as super user.
-ameans add operation,
-Gmeans additional group.
Type following command:
usermod -a -G sudo john
root@debian# groups john john : john sudo
Note: we can see now
johnis assigned to