Create a New User from the terminal on Ubuntu

By

Vineel Sai

profile

Root User

Before you get started make sure you are in root user with the following command.

sudo sh

Adding a New User

  • Run the following command to create a new user.
adduser username
  • You will be asked to enter a password for the user and confirm it and you will be asked to enter some details about the user you can either fill them or leave them empty.

adduser

Adding the User to the sudo Group

  • Run the following command to add the user to the sudo group.
usermod -aG sudo username

adduser

Switching to the New User

  • Run the following command to switch to the new user.
su username

adduser

Testing sudo access

  • To make sure that the user has sudo access run a command with sudo.
sudo apt update

adduser