Users and groups

Adding an existing user to an existing group

usermod -a -G theExampleGroup theExampleUser

Changing the primary group of an existing user

usermod -g theExampleGroup theExampleUser

See wich groups the user belongs to

groups theExampleUser

Add an existing user to the sudo group

usermod -aG sudo username

 Add a new user with name, shell and home directory

sudo useradd -m -c "Samwise the Brave" sam  -s /bin/bash

 

https://www.cyberciti.biz/faq/howto-linux-add-user-to-group/

https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart

https://askubuntu.com/questions/643411/ubuntu-14-04-new-user-created-from-command-line-has-missing-features

 

Back to top