How To Add A New User In Ubuntu Using The Command Line
In this tutorial we will cover how to add a new user on ubuntu with the command line. The following commands will work on a desktop system as well as a server. The commands can also be applied on most other Linux distributions as well.
In the following examples we will setup a new user called tony. We will set the account up with sudo privileges and add the account to a few groups.
We will be doing this all in a terminal. If you are not sure on how to open a terminal on you can take a look at one of the follow tutorials on how to do this. Let’s get started!
How to create a user:
If you want to add a user to your system you can use the adduser command. Since this requires you to have root or admin privileges you will need to use sudo along with the command.
sudo adduser USERNAME
Example: Add user Tony Smith.
sudo adduser tony
Note: The username is the name the user will login with. It is best practice to keep the name all lowercase, and yes it does matter in Linux.
Enter your password to complete the command with sudo privileges.
Enter the password for the new user
Confirm the password for the new user
Enter the users full name or amount of information you want to include.
Enter some other optional information. In this example I am just going to leave it blank.
Confirm the information is correct and enter “y”
You should now have your new user added with very basic privileges.
You can confirm this by viewing the /etc/passwd file. This file holds basic user information.
Also check out the tutorial on how to set a user up with sudo access:
If you enjoyed this post, please share it on your favorite social network by clicking on the “Share / Save” bar below.