How to Add a User in Linux: A Step-by-Step Guide (GUI + CLI)

Sohail
Sohail

Table of Contents

Adding a user in Linux is simple. It can be done through the command line interface. Users are important for managing access to files and system settings and creating a new user can be useful for granting specific permissions or separating different users’ activities. Here’s how to add a user in Linux.

Users are accounts in Linux that define the level of access to particular files and system settings. Usually, you already create a user when you install the OS for the first time but you may need to create more users later for various purposes like different persons using the same computer.

How to add user in Linux?

Basically there are two ways to create a new user in Linux- by using Graphical User Interface(GUI) or Command Line Interface(CLI), I’ll be detailing both the methods in this article and the OS I’m using is Ubuntu 16.10 but it should more or less the same way in other Ubuntu-based distros.  

GUI Method:

Open System Settings and click on User Accounts, a window will popup. Alternatively, if you’re running Unity GNOME search for User and open User settings from the results. On the upper right-hand corner you need to click on Unlock and enter your password to allow access in modifying the user accounts. At the lower left-hand corner of the window, click on the little plus sign.

Unlock users settings in GNOME
Unlock users settings in GNOME

In the small window that opens, fill the various fields and choose between Standard and Administrator (In short, Administrator has more access than Standard account type) and then click on Add.​

Add user in linux
Add user in linux

Your new user account is added but it’s recommended that you add a password before logging in to it.

Just click on the field next to Password to add a password and click on Change. You can also enable Automatic login and change the Language.

CLI Method:

It is also possible to add a user using the command line in Linux. The command is “adduser” followed by the username and other parameters like the home directory, shell, etc. You can also create a password for the user with the “passwd” command. Once you have created the user you can set up permissions and access levels using “chmod”.

create new user in linux on cli

Open the Terminal by searching for it in the Dash or pressing Ctrl+Alt+T together. Once it opens, type the command “sudo adduser” and after space write the name of the User account you want to give and press Enter. For example, “sudo adduser legion”.

sudo adduser

Once it creates the User, you need to enter a password and then enter it again to confirm it.

create user password in ubuntu cli

Then you can enter various fields or just leave them blank and press Enter. After that type “y” to confirm and press enter.

Your new user account is created using CLI.  

Conclusion

As you can see creating a new User Account in Linux is quite easy. In fact it’s easier than Windows in my opinion. It is also one of the few things in the Terminal that new users can easily understand. Please let me know if you have any questions regarding the above steps. Thanks for reading!

Linux TutorialsUncategorized