In this article, we will describe how to define user creation and root rights in our Centos instance.

To connect to your instance, you need to follow the steps in the Remote Access to Your Instance article.

You can connect to your instance via

ssh -i <path/to/file.pem> <defaultusername>@<instance_public_ip>
CODE

Switch to root user to add user.

$ sudo su 
CODE

Use the adduser command to add a new user to your instance.

# adduser <username>
CODE

Use the passwd command to update the new user's password.

# passwd <username>
CODE

Set the password for new user

Changing password for user <username>.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
CODE

We need to add the user to the wheel group in order to give the root rights to the new user.

# usermod -aG wheel <username>
CODE

Test sudo access on new user account :

# su <username>
CODE