
Linux Command Line
The “adduser” command is used to create a new user on a Linux system. Here is a quick guide on how to use it:
- Open a terminal window.
- Type the command “sudo adduser” followed by the username of the user you want to create. For example:
sudo adduser newuser
- Press enter and you will be prompted to enter a password for the new user.
- Re-enter the password to confirm it.
- You will be prompted to enter additional information such as the user’s full name, phone number, and so on. You can press enter to skip any fields that you don’t want to fill in.
- Once you have filled in all the information, the user will be created and added to the system.
- To add user to a specific group use the option -g (groupname).
- To assign a specific home directory to the user, use the option -d (directory).
- To assign a specific shell to the user, use the option -s (shell).
- Once the user is created, you can use the command “id” to check the user’s UID and GID
id newuser
You can also use the command “cat /etc/passwd” to check the user’s information.
Please note that, you need to run the command with super user privileges in order to use “adduser” command, that’s why we are using “sudo” before the command
See our list of 75 Linux commands you should know about.