Ubuntu Add User to Group
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.