Skip to main content
Skip table of contents

How to Create User on Ubuntu Server

In this article, we will describe how to define user creation and root rights in our server with Ubuntu operating system.

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

You can connect to your instance via

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

Switch to root user to add user.

CODE
$ sudo su

 

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

CODE
# adduser <username>

Set the password for new user

CODE
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully 

Follow the promts to set the new user's information. You can accept the defaults to leave all of this information blank.

CODE
Changing the user information for <username>
Enter the new value, or press ENTER for the default
 Full Name []: 
 Room Number []: 
 Work Phone []: 
 Home Phone []: 
 Other []: 
Is the information correct? [Y/n]

We need to add the user to the sudo group in order to give the root rights to the user we created.

CODE
# usermod -aG sudo <username>

 

Test sudo access on new user account:

CODE
# su <username>

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.