add new user and then add to a group ubuntu code example
Example 1: ubuntu add user to group
sudo usermod -a -G group username
Example 2: how to create a user and add it to a group in linux
useradd -G examplegroup exampleusername
sudo usermod -a -G group username
useradd -G examplegroup exampleusername