Ubuntu Add User to Group
Here I will show you how to Ubuntu add user to group. The user needs to exist before we can put him into a group. Check out Ubuntu Add User, if you don’t know how to do it.
We will use the same user as in previous example. We have created the user John. And now we want to put him into the Sudo group. Here is how we do it:
sudo adduser john sudo
John is now a member of the sudo group. But if he is logged in, he will need to re-log for the new group membership to take effect.
Later if you need to remove John from the sudo group. Just run:
sudo deluser john sudo
This will not delete the user. It will only remove him from the sudo group.
That is it really.
Happy grouping!