2 Ways to Create a New User in Linux for Beginners (Complete+Pictures)
User management is an important thing in an operating system, for example on the Linux operating system. Each user has at least their own account when accessing Linux so that each user has its own user and home folder. This will also prevent damage and access to data or files by unauthorized parties, in other words, every user has data private which is not shared publicly.
With user management, users can set the access rights of each file/folder in the form of access rights for the owner (owner), group and public (general). In addition, users can also set access rights to other users, such as which user has access rights as: administrator (root) or normal user.
In short, Linux Ubuntu provides multi user accounts that allow you to create multiple users in an Ubuntu operating system. How do I create a new user on Linux Ubuntu? For further explanation, let’s see the explanation below.
How to Create a New User on Linux Ubuntu
Creating a new user on Linux Ubuntu is quite easy and simple. There are two commands that you can use to create a new user in Ubuntu: Adduser and Useradd.
What is the difference between the two?
- useradd creates a user without being asked to set a password. Meanwhile, adduser creates a user by setting/setting a password first at the same time.
- useradd create a user without creating a home directory. Meanwhile, adduser creates the user and his home directory.
- useradd create a user without including a complete description of the user. Meanwhile, adduser creates a user by including complete information about the user.
So that you can understand the difference between the two commands better, let’s see how to create a new user in Ubuntu using the two commands and see the difference.
A. Create a New User With the Adduser Command
1. To create a new user, you must be logged in as root by entering the word “sudo” at the beginning of the command you want to execute. Here we will create a new user with adduser with the command sudo adduser
2. After that, you will be asked to fill in the information for the new user such as full name, phone number and others (you can leave information that you don’t need).
3. When finished filling in the information, type the letters “Y” as confirmation that the information you have made is correct.
4. Now, you can login with your new user account by typing the command sudo login
B. Create a new user with the command Useradd
1. To create a new user, you must be logged in as root by entering 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
2. Since useradd doesn’t ask you to set a password, you can still create a password for that user by typing the command sudo passwd
3. Now, you can login with your new user account by typing the command sudo login
4. To exit the user, type the command exit.
C. See All List of Users in Ubuntu
To see all the list of users on your Ubuntu, you just type the command cat /etc/passwd then press Enter.
Well, the result will look like in the image below, you can see in the last two lines there are users hannani123 and nabilah that we created earlier.
That’s a discussion about how to create a new user on Linux Ubuntu with the command Adduser and Useradd. Well, hopefully the discussion that has been explained above is useful and good luck. Thank you!
“If you’re doing your best, you won’t have any time to worry about failure.” H. Jackson Brown, Jr.
Post a Comment for "2 Ways to Create a New User in Linux for Beginners (Complete+Pictures)"