User management is important in an operating system such as on a Linux operating system. Each user has at least a separate account when accessing Linux so that each user has their own user and home folder. This will also prevent damage and access to data or files by unauthorized parties. In other words, each user must have private publicly distributed data
. With the user management, users can set rights access from each file / folder in the form of access rights for owner (owner), group and public (general). In addition, users can also set permissions on other users such as which user has access rights as administrator (root) or regular user
In short, Ubuntu Linux provides a multi user account that allows you create many users in an Ubuntu operating system. How do I create a new user on Ubuntu Linux? For more explanation let's see the explanation below
How to Create a New User in Ubuntu Linux
Creating a new user on Ubuntu Linux is easy and simple. There are two commands you can use to create a new user in Ubuntu namely Adduser and Useradd .
What is the difference between the two?
- useradd creates unassigned users for set / set password. Meanwhile, the adduser creates the user by setting the password first simultaneously.
- useradd creates the user without creating the home directory. Meanwhile, the adduser creates the user along with the home directory.
- useradd creates the user without including a full description of the user. Additionally, the adduser creates the user by including a complete description of the user.
In order to better understand the differences between the two commands, let's look at creating a new user in Ubuntu using both commands and see the difference.
A . Creating New User With Adduser Command
1. To create a new user, you must be logged in as root by including "sudo" at the beginning of the command you want to execute. Here we will create a new user with adduser with command sudo adduser
2. After that, you will be asked to fill in information for new users such as your full name, phone number and others (you can empty the information you do not need).
3. After completing the information, type "Y" as a confirmation that the information you have made is correct.
4. Well, now, you can login with your new user account by typing sudo login
B. Creating a New User With Useradd Command
1. To create a new user, you must be logged in as root by including "sudo" at the beginning of the command you want to execute. Here we will create a new user with useradd with command sudo useradd
2. Because useradd does not ask you to set a password, you can still create a password on that user by typing sudo passwd
3. Well, now, you can login with your new user account by typing sudo login
4. To exit the user, type command exit .
C. Viewing All the List of Users in Ubuntu
To see all the users in your Ubuntu list you just type the cat / etc / passwd command and press Enter .
Well, the result will look like in the picture below, you can see in the last two lines there are user hannani123 and nabilah we have created before
So many discussions about how to create a new user on Ubuntu Linux with the Adduser and Useradd commands. Well, hopefully the discussion described above is helpful and good luck. Thanks!