Day 5 Of 90 Days Of Devops

I am a DevOps Engineer with an aim to learn and contribute to the Tech World!!
📝 Blogging and Sharing: On this platform, I'll be sharing insightful articles, tutorials, and tips on all things DevOps. Expect deep dives into CI/CD best practices, IaC patterns, containerization strategies, cloud optimization, and much more. Let's learn and grow together!
Today I am going to discuss about the below mentioned topics in Day 5 of ⭐⭐#90daysofdevops ⭐⭐
✔User and Group Management in Linux
✔How to Give/edit the file permission in Linux
User Management Command in Linux
To add a User
$ sudo useradd -m manash

To find out How many users are there
$ cat /etc/passwd
To add a group : group is a collection of user and we create a group such that if we want to give some specifice permission so it is better if we give that permission to group such that all the users in that group can also get the permission rather to give permission one by one to every user
$ sudo groupadd devops #Here the devops is the group nameTo append user in a group
$ sudo usermod -aG devops manash #Here -aG means append to group #Here devops is the name of the group in whcih we are appending user #manash is the user whcih we are appending to groupTo add multiple user to a group
$ sudo gpasswd -M amrit,manash devops #here amrit,manash is the multiple user that we want to add to devops group #here -M means Multiple for multiple usersTo delete a group
$ sudo groupdel devops #Here devops is the group name that we are deleting #Note: keep in mind that even if we have deleted a group but still the #users will exists
File Permission in Linux
- Command to check what permission we have for our files
$ ls -l
#Here ls means list it will list out all the files and directory
#Here -l is the option that will give the complete description of the file/
#directory

Here you are able to see that we are getting complete info about the files/directory
if it is starting with d it means that it is a directory
And then you are able to see that it is written like rw-rw-r-x
that means r stands for read , w stands for write and x stands for execute
There are three types of permission class
User ,group,others and each one holds three places for the permission
For example
rw-rw-r--
Here rw- is used for user where we have give read and write permission but no execute permission
rw- is used for group where we have given read and write permission but no execute permission
r-- is used for other user where we have just given the read permission
read stand for 4, write stands for 2 and execute stands for 1
so if we want to give the read and write and execute permission to user and only read permission to both group and other
command that we will write is as below mentioned
$ chmod 744 colors.txtPrevious screenshot for the permission of the file

After screenshot for the permission of the file

Kindly like the blog post if you like it
Happy Learning All !!
Regards,
Amrit Manash

