How to add a new group to user root?

To add a particular user to a particular group use:

sudo usermod -a -G groupname username

Here a is very important because otherwise the user will be removed from all other groups

Your problem is probably because you missed the -a part in your command


You can add any user to any group by typing:

sudo gpasswd -a username groupname