You can create user, set the password and change the password in a minute. You can also create the group then assign the users to that group. It’s so easy fast to create the user using Linux command. If you are not familiar with the Linux command check out Beginner Linux command tutorial[Part 1] and Beginner Linux command tutorial[Part 2].
To add the user:
You need to have the root access to add the user. The syntax to add user is:
sudo adduser username
If I want to add the user “hello”, I would type:
Authorize and it will create the user hello. In the process, it will ask you to input the Unix Password which means the password of the user “hello” that you just created. Type the password, retype it and again it will ask the information of the user “hello”. Fill the information and click “Y” to let know that the information you entered is correct.
You successfully create the user hello and also set the password(for example: hii). What if you want to change the password?
To change the password of the user:
You also need to have root access to change the password. The syntax to change password is:
sudo passwd username
To create the group:
Now, I want to create the group and assign various users to that group. The syntax to create the group is similar to that of user:
sudo addgroup groupname
If I want to create the group called groupies I would type:
I have created the group called “groupies” and I am willing to add the user “hello” and “sachit” to the groupies.
To assign the users to the group:
The syntax to add users to a group is :
sudo usermod -a -G groupname username
To add users ‘sachit’ and ‘hello’ to the group ‘groupies’ I would type:
To view the user information: cat /etc/passwd
To view the group information: cat /etc/group
Also, the syntax to delete the user and group is:
sudo userdel username
sudo groupdel groupname