How to add a new user on Ubuntu

The problem with logging in as root is that you can execute any command - even a command that could accidentally break your server. For this reason and others, we recommend creating another user account and using that at all times. After you log in with the new account, you’ll still be able to execute superuser commands with the sudo command.

Here’s how to add a new user on Ubuntu:

Ubuntu

Open a terminal window and log in to your server via SSH.
Create the user by entering the following command. Replace exampleuser with your desired username:
adduser exampleuser
Add the user to the administer the system (admin) group by entering the following command. Replace exampleuser with your username:
usermod -a -G sudo exampleuser
Log out of your server as the root user by entering the following command:
logout
Log in to your server as the new user by entering the following command. Replace exampleuser with your username, and the example IP address with your server’s IP address:
ssh exampleuser@122.222.22.22

 

  • 123 Users Found This Useful
Was this answer helpful?

Related Articles

How to Install a Firewall on Ubuntu

So you want to setup a firewall to limit and block unwanted inbound traffic to your Server....

Installing and Configuring Fail2Ban for Ubuntu

Fail2Ban is an application that prevents dictionary attacks on your server. When Fail2Ban detects...

Disabling SSH Password Authentication and Root Login for Ubuntu

You just strengthened the security of your Server by adding a new user and generating SSH keys....

Initial Steps to securing your Ubuntu server

Securing your Ubuntu server is a big step in the right direction and most importantly it will...