In this tutorial, we are going to see how to create a new user account on Ubuntu using the Terminal. This created user will be assigned a password and a home directory. In this tutorial, we will use "username" as an example of a new user, you can change it to any name of your choice.
1. Launch the Terminal (Ctrl+Alt+T) and run this command to create a new user:
sudo useradd username
Replace "username" with the username you want to create.
2. Now assign a password for this new user with this command:
sudo passwd username
Create now a home directory for this new user with this command (I named the directory the same as the username):
sudo mkdir /home/username
Run now this command to change the owner of /home/username to this new user:
sudo chown username /home/username
Now grant access to this new user to /home/username with this command:
sudo chgrp username /home/username
You have now successfully created a new user. This user account will begin to appear in the login window at Ubuntu startup. If you want to grant this user root privileges (user can execute "sudo" commands), which is not a recommended step (be careful), then use this command from the Terminal:
sudo adduser username admin