Hello and welcome back to this video.
So we have seen about Linux permissions the three
people which is the user group and others to
whom the permissions are given now, let
us see in case we want to give
some permission to someone. How do we do that?
So let's quickly see over here.
This is the file which is x y z and we have
seen the permissions which are given to the
user which is read right the group which is
read and others the permission is given which
is only read. So let's now give
the permission to others of right as
well. So
We have to give a permission to others so for
that we are going to use the command chord and
we need to give the permission to whom to
others. So for that we have to press o
because we need to give permission to others and
we are giving permissions. So we are going
to write a plus in case we need
to remove the permission then what
should we write? Right we need to
add a minus. But in this case, we are
giving
Permission. So we are going to add Plus.
And what permission we need to give of right
so we are going to use W perfect.
So now this is a very
very simple to understand chord is something that you have
to write you need to give permission to others. So,
oh you have to give permission. So
we are adding a permission which is
denoted by plus and which permission you
are giving it is right permissions. So w
and the name of the file to which these changes need
to be done. Now this looks perfect. Now
after we type this command what
is going to happen?
Let's see it on to the terminal so chmod
and we need to give a permission.
So o plus W.
And to the file XY said and hit enter.
And the command got executed without any
error. Let's quickly see the permissions now
and
here we can see a extra W has
been added which cannot be seen over here. Now.
This means the permission has been successfully added
to the file XYZ. And now
the users the other
users can edit the file as
well. So let's quickly switch user to
the user udemy and now
We are udemy. Let's verify that who am I? I'm the
user udemy and now we have the right
permission as well. So let's really read first. So
read get XYZ and we
can see we are able to read it. Let's quickly modify
it using Nano and
let's write this is modified by
udemy. Let's try to save it.
And we are successfully able to save it.
Let's see if our changes are successfully
saved.
And you can see this is modified by Jeremy. Let's
verify again. Let's try to read
this file by the user root. And yes.
We are able to successfully see the changes that
has been done into the file by the other
user which is udemy. Perfect.
So now we know how to give permission. So
I hope you guys understood how you can
give permissions to any user. So
in case you want to give permission to a group for
that you're using the symbol G Plus which
permission you need to give read write
execute and the file name similarly. You want
to give some permission to the user who has created the
file. So let's say U plus r w x and x
y z. Let's try to see it over
here. Let's try to see the first the permissions and
let's give all the permissions.
To the user so you plus r w
x and the file name.
Let's see the permission now and you can see read write
execute is the permission which is given 2 the
user. So now all the
permissions are being to the user the
group has the read permission and others have
reached right permission. Now in case you want to give
all the permissions to everyone all the three
category of people which is the user group
and others for that. You simply need
to write chord A a means all
and what permission you need to give.
all the permissions
So you can do it this way. Let's try to see the
permissions now and you can see rwx rwx
and rwx now. All
the permissions are given to the user group
and others perfect.
Now you must be wondering what does this
hyphen represent? This basically represents in
this case. Nothing that this is a
file in case it is a directory there would
have been a d over there which represents
that this is a directory and
it is not a file. That's it. So, I hope you
guys understood this how you can add permissions in
the next lesson. We are going to see how you can
remove permissions. Thank you.