How to create a new user on Ubuntu

How to create a new user on Ubuntu

Adding a user is essential after a new server is set up. Using the root credentials can pose many security issues. In Ubuntu, sudo can be used to run commands with administrative privileges as another system user to preform these actions.

This guide will discuss how to create user accounts and assign sudo privileges.

1️⃣ To start, login to your root access and add the below command

adduser testuser

If you are already a sudo user and want to add a new user with sudo permissions, always add sudo to the beginning of the command for the steps ahead. Example:

sudo adduser testuser

2️⃣ Now add the created user to the sudo group which will assign it admin privileges

usermod -aG sudo testuser

3️⃣ Now run the below command to verify permissions are available, you should see:

(ALL : ALL) ALL
sudo -l

Done!