Guide to Basic User Management Commands
Table of contents
User
How to add user to the system and setting the password to that user and modify the user details and add user to specific groupGroup
How to create group and add a group to specific userBefore using the command make sure that you logged as a root user
HOW TO ADD USER TO THE SYSTEM
The useradd command is used to add or create so many user to the system
useradd lalitha
lalitha is a user add to the system
How to see lalitha is added as a user to the system
cat /etc/paaswd
it display the user id ,home directory and username of all created user
if you want to see a specific user id, home directory etc...
you have to give
id lalitha
it give specific user id, home directory , user name and group name also
HOW TO SET PASSWORD TO SPECIFIC USER
The set passwd is used to set a password to a specific user
passwd lalitha
it first ask to set the password and again it ask to retype if it display authentication successful then the password is setup for a specific user.
MODIFYING USER DETAILS
The usermod -d is used to change the home directory of the user
usermod -d /home/newjohn john
ADDING USER TO SPECIFIC GROUP
the usermod -aG is used to add the user to specific group
usermod -aG techdev lalitha
DELETING THE USER FROM THE SYSTEM
userdel is used to delete the user from the system
userdel lalitha
ADDING OR CREATING A GROUP
the groupadd command is used to add or create group in the system
groupadd devtech
how to check the group is created
cat /etc/group
it display the group name, id of all
to check the details of specific group
id group name is used to display specific group id,name etc..
id devtech
how to add a user to specific group
you already saw one method that is usermod -aG group name username another one is
chgrp group name username
HOW TO DELETE A GROUP FROM THE SYSTEM
groupdel is used to delete a group from the system
groupdel devtech
its delete or remove the group
that's all we will meet soon.....
bye.....
Subscribe to my newsletter
Read articles from Pooja Manellore directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Pooja Manellore
Pooja Manellore
I have completed my B.Sc. in Computer Science in 2024 and have gained skills in Data Analytics, HTML, and CSS. I am currently advancing my expertise by learning DevOps, aiming to secure a role as a DevOps Engineer. I am eager to join a company immediately where I can apply my skills and continue growing in this field