Add a new user on Ubuntu 22.04

Create a New User in Ubuntu 22.04 or 20.04 using GUI or Terminal

Posted on

On this tutorial, we are going to be taught the steps to create a brand new consumer in Ubuntu 22.04 Jammy JellyFish or Ubuntu 20.04 Focal fossa both utilizing the command terminal or GUI- Graphical consumer interface.

Like home windows, we are able to add customers on Ubuntu 22.04 or 20.04 with completely different rights similar to one with sudo and one other with out. This helps a number of customers to work on the identical system whereas their information and listing can solely be accessible by them. Though the foundation or Tremendous Admin consumer can entry every other system/common consumer account and its information, the usual/common consumer account can not. The method of making a brand new consumer is just not a lot troublesome even on Ubuntu Linux. We will use the terminal or GUI interface of the OS to try this. Aside from making a consumer on Ubuntu 22.04, we will even learn to assign sudo rights to a consumer utilizing this step-by-step information.

Steps to create a brand new consumer in Ubuntu 22.04 or 20.04 Linux

Word: To make use of the command or GUI for including a brand new consumer, you need to have already got root or a consumer with sudo rights.

#1st Utilizing the terminal:

1. Acess Terminal

If you’re utilizing a CLI interface of Ubuntu 22.04 Server or need to use the Terminal app on GUI Linux to create a brand new consumer, then first entry the identical. Those that are utilizing a GUI Ubuntu Desktop can use the keyboard shortcut Ctrl+Alt+T.

2. Add a brand new consumer on Ubuntu 22.04

Now, so as to add a brand new consumer utilizing the terminal use the command known as adduserProperly, the command itself explains all the pieces, it’s straightforward to recollect and must be executed with sudo and the title of the consumer you need to add.

Syntax:

sudo adduser username

For instance, if we need to add a consumer named- h2smedia, then the command might be:

sudo adduser h2smedia

Simply substitute the h2smedia with the username that you simply need to add.

Add a new user on Ubuntu 22.04

As you run the command, the system will ask you to enter your consumer (sudo) password to execute the command. After that kind the password that you simply need to set to your newly created consumer.

As soon as the password is ready, it additional asks for some extra info such because the Full title of the consumer, cellphone quantity, and others. If you wish to set them then enter the required values in any other case merely press the Enter key many times till you get the “Is the knowledge right? [Y/n]” query. Kind Y and hit the Enter key once more to create the brand new consumer.

3. Test consumer added efficiently or not

Now, to verify that the consumer has been created efficiently, use the given command:

cat /and so on/passwd | grep consumer

Substitute the consumer with the one you will have created within the above command.

Check Linux user added successfully or not

4. To Checklist all customers on Ubuntu 22.04 or 20.04

Whereas to checklist all accessible customers, we are able to use:

reduce -d: -f1 /and so on/passwd

For solely all regular (non-system and so on) customers:

awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /and so on/passwd

5. Tips on how to assign Sudo to a consumer

Now, should you additionally need to give sudo rights to your newly created in order that it may execute the command with Admin rights then that can be potential. Merely, add your consumer to the sudo group.

sudo adduser consumer sudo

For instance, right here now we have a consumer h2smedia and if we need to present it sudo rights then the command might be:

sudo adduser h2smedia sudo

6. Revoke or take away sudo rights

Properly, perhaps later you need to revoke or take away the sudo entry given to the created or from any present consumer. For that we are able to go for the given command syntax:

sudo deluser consumer sudo

For instance:

sudo deluser h2smedia sudo

7. Change consumer title

The username will be simply modified utilizing

sudo usermod -l new-username old-username

For instance:

sudo usermod -l myh2s h2smedia

Nevertheless, that is solely potential if the consumer title to be modified is at present not lively (i.e. not logged on to the system).

8. Delete a consumer from Ubuntu 22.04

Maybe later you don’t require some consumer in your Ubuntu Linux system, in such a case we are able to delete them even the one you will have created. For that the command syntax might be:

sudo deluser consumer

For instance:

sudo deluser h2smedia

Delete consumer together with knowledge from the house listing:

sudo deluser --remove-home h2smedia

#Utilizing GUI to create a consumer

9. Open Ubuntu Settings

If you wish to add a brand new consumer account, you’ll be able to simply management all the pieces by way of the graphical consumer interface. First, open System Preferences. You possibly can obtain this, for instance, by clicking on one of many icons within the standing menu, which is positioned within the higher panel on the far proper. From the pop-up menu, choose Settings.

Open Ubuntu Settings

Within the new window, navigate to the Customers part within the left pane. Now unlock so as to add customers and alter settings by way of the button of the identical title shows additional as an possibility. After you will have legitimized your self together with your password, click on Add Consumer Account.

unlock to add user and change settings

10. Add a Consumer account utilizing Ubuntu 22.04 GUI

Then choose the account kind. The default is a Customary account, which needs to be sufficient for many use circumstances, particularly should you want a restricted account to check. If additional authorizations as an admin or sudo are required later, you may as well change the function later from Customary to Administrator.

Add a User account using Ubuntu 22.04 GUI

You then set the total consumer title and the consumer title. If you kind within the full title, the consumer title is robotically populated primarily based on it. Areas are omitted right here.

Lastly, it’s nonetheless obligatory to manage password task. You possibly can depart it to the consumer to decide on a password the primary time they log in. Nevertheless, you’ll be able to set it manually by your self for the brand new consumer.

Add a User account using Ubuntu 22.04 GUI

The energy of the password will consider by the system utilizing coloured bars. When you choose to have a random password generated, click on on the small icon on the finish of the password area.

Generate random password for Ubuntu user

After you will have set all of the choices, click on on the Add button on the high proper of the dialog. Present your system password to execute the duty. You’ll then be taken again to the primary window. There you will have one other alternative to examine the settings for the brand new consumer account and, if obligatory, to make corrections.

11. Take away Consumer (elective)

In case you need to take away the added or present commonplace consumer account utilizing GUI then that can be potential. Go to the Customers, choose the account you need to delete after which click on on the Take away Consumer button.

Remove user in Ubuntu 22.04

FAQ

How do I checklist all customers in Ubuntu?

Open the command terminal in your Ubuntu Linux and execute the command reduce -d: -f1 /and so on/passwd

What number of kinds of customers are there in Linux?

There are three kinds of consumer accounts in Linux- one is Root consumer account and the others are a Common consumer account, and a Service account.

The basis consumer account is the primary tremendous admin account on Linux created robotically in the course of the set up of the OS. It has entry to the entire system, providers, and information. In brief, we are able to do any administrative work utilizing it. Therefore, if required will be disabled however we can not delete it.

An everyday consumer account is created robotically or we are able to create one manually with reasonable privileges. This sort of account can not execute Admin duties till sudo rights should not offered.

Service accounts are created by set up packages.

How do I take away a consumer from Ubuntu?

To take away or delete any present consumer from Ubuntu open your terminal and run the given command:

To delete solely the consumer:

sudo deluser username

To delete the consumer and all its knowledge saved beneath its house listing:

sudo deluser --remove-home username

How do I modify customers within the terminal?

To alter the consumer account with out logging out of the system within the terminal, we are able to use the su command. Right here is the syntax:
su username
For instance:
su h2smedia

What occurs should you delete Customers in Linux?

If in case you have used the command to solely delete the consumer then the system will solely take away the consumer however not its folder and information residing beneath its house listing. Nevertheless, if deleting the consumer together with all its information then the system will clear all information created by that consumer account.

When Customers are deleted what occurs to their information Linux?

Nothing will occur to the information of the deleted consumer until you execute a command to delete the information as nicely. However when you have opted for deleting all knowledge together with the consumer then the system will even take away all information and folders of the deleted consumer.

Different Articles:

How to install sudo on Debian or Ubuntu Linux
2 Ways to add users to a sudoers group in Debian 11
How to change Ubuntu Linux name Graphically
How to change the Computer name in Ubuntu 20.04 Linux

offshore vps