Hey, welcome back.
So now we are going to see how we can remove permissions
in Linux. All right,
so in the previous lesson we have seen how to add permissions removing
permissions is exactly the
same way. It's very very simple.
So as we can see over here, what are
the permissions given to the file XYZ we
can see we have given all the permissions to
everyone. So let's quickly now remove
the permissions for others, which
is oh, right?
So for that we are going to write chord and O
minus because we need to remove permissions
this time for others and
which permissions so let's try to remove
all the permissions so minus r
w x and for the file x y
z. So let's quickly write this chord o
minus r w x for x
y z and let's quickly see the permissions now
and you can see there are three dots
or three hyphens, which
basically means that there is no permission
which has been given to the file XYZ and
we have successfully removed all
the permissions of read right and execute.
Now, let's quickly verify this. So let
me switch user to uremi.
And we have switched the user. Now. Let's
try to read this file. So cat XYZ and
according to the permissions that
we have given we should not be
able to read the file. So let's try and verify
this. So let me just press enter and
let's see. What is the output that we
get?
And correct. It says permission denied
because there is no read permission
which has been given to this file. Perfect. Let's
try to write it and for
obvious reasons, we are going to get the same
error which is permission denied. Let's verify this
and you can see the error which is permission denied.
We can neither read
or write.
Also, we cannot execute it.
Perfect. Let's go back and let's try
to read the file with the root user and we
are able to read the file because the
root user currently has all the
permissions as we can see over here. So I
hope you guys understood how you can remove
permissions for user group
and others. Thank you.