User management is important in an operating system for example on the 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 data that is not shared publicly.
With the management of the user, users can set the permissions of each file / folder in the form of access rights for the owner (owner), group and public (general). In addition, users can also set permissions on other users such as which user has administrator privileges (root) or a normal user.
In short, Ubuntu Linux provides a multi user account that lets you create multiple users on an Ubuntu operating system. How do I create a new user on Ubuntu Linux? For further explanation let’s look at 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 an unsolicited user to set / set password. Meanwhile, the adduser creates the user by setting / password first simultaneously.
useradd creates the user without making the home directory. Meanwhile, adduser create user and home directory.
useradd creates a user without including a full description of the user. Meanwhile, the adduser creates the user with a full description of the user.
In order to better understand the differences between the two commands, let’s look at how to create a new user in Ubuntu using both commands and see the difference.
A. Creating a New User With the Adduser Command
1. To create a new user, you must be logged in as root by including the word “sudo” at the beginning of the command you want to execute. Here we will create a new user with adduser with sudo adduser command <username>. For example: sudo adduser hannani123. Then press Enter. Then, you will be asked to enter a password for your new user.
2. After that, you will be prompted to fill in information for new users such as your full name, phone number and more (you can empty information you do not need).
3. When finished filling in the information, type the letter “Y” as a confirmation that the information you made is correct.
4. Well, now, you can login with your new user account by typing sudo login <user name> command. Example: sudo login hannani123.
B. Creating a New User With Useradd Commands
1. To create a new user, you must be logged in as root by including the word “sudo” at the beginning of the command you want to execute. Here we will create a new user with useradd with the command sudo useradd <username>. For example: sudo useradd nabilah. Then press Enter.
2. Because useradd does not ask you to set a password, you can still create a password on that user by typing sudo passwd command <username>. Example: sudo passwd nabilah.
3. Well, now, you can login with your new user account by typing sudo login <user name> command. Example: sudo login nabilah.
4. To exit the user, type the exit command.
C. View All List of Users in Ubuntu
To see all the user lists in your Ubuntu, you just type in the command cat / etc / passwd 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 made before.
So many discussions about how to create a new user on Ubuntu Linux with the command Adduser and Useradd. Well, hopefully the discussion described above is helpful and good luck. Thank you!