The most popular and well-known open source operating system is Linux. As an operating system, Linux is software running in the background of all other applications on a computer, receiving requests from them and passing them to the hardware. It is very likely that you will have to create users and groups if you manage a Linux server. You will have some important limitations if you don’t know how to create users. To begin with, a system cannot accept new users. Second, you may find that to install software you need to establish a user. As for groups, this is an excellent approach to managing user permissions for directories, aside from the requirement that groups be created for successful installation of specific applications. We have mentioned below the steps to create users and groups in Linux using command line.

Steps to Create Users and Groups in Linux Using Command Line

creating users

We must employ the useradd command in this situation. You can create users who can login or even users who cannot login with this command, which is quite flexible (in case of creating a user for a software installation). Step 1: The basic syntax of the command is: Step 2: Do you want create user olivia so much so that she has a home directory and can log in. If you issue the command: Step 3: the user would be addedwithout one home directory and be prevented from logging in. Instead of issuing the command with no arguments, let’s go with this: Step 4: The above command would create the user and also create the user home directory to match the username. So if you looked in the 🇧🇷home directoryyou would now see olivia. Step 5: But that’s it lock problem🇧🇷 There are two ways you can do this. If you have already created the user, you can issue the command: Step 6: You will be asked to come in and check the new password. At this point, the user’s account will be unlocked and they will be able to login. Step 7: If you want to do this all in one single stepthis command would look like this: Step 8: Where PASSWORD is the password you want to use for the user olivia. Step 9: After the user logs in, he can change his password using the passwd commandentering the current password and then entering/verifying the new password. Step 10: If you need create a user that doesn’t have home directory and is blocked from logging inyou can do this with the following commands:

Creating groups and adding users

Step 1: Now it’s time to create a group. Let’s create the group editorial🇧🇷 To do this, you would issue the command: Step 2: Now we want to add our new user, olivia, to the group’s editorial. For this, we will take advantage of usermod command🇧🇷 This command is quite simple to use. Step 3: The -a option tells usermod that we are appending and the The -G option tells usermod we are appending to the group name that follows the option. Step 4: Do you know which users are already members of a group? you can do it old-fashioned so: Step 5: Another method of finding out who is in a group is with the members of the command. This command is not installed on most distributions, but it can be installed from the standard repositories. If you are using a ubuntu distributionthe installation command would be: Step 6: Once installed, the command to list who is in our editorial group would be:

Final Words

We hope you enjoy our article on how to create users and groups in Linux using the command line. You have direct access to a computer through the command line. It’s where you instruct the software to perform tasks that point-and-click graphical user interfaces (GUIs) cannot. In many operating systems, whether proprietary or open source, command lines are provided. But since command lines and open source software together grant users free access to the computer, they are often tied to Linux.

How to create users and groups in Linux using command line - 53How to create users and groups in Linux using command line - 31How to create users and groups in Linux using command line - 58How to create users and groups in Linux using command line - 80