WEBVTT - This file was automatically generated by VIMEO

0
00:00:04.300 --> 00:00:06.300
Hey, welcome back.

1
00:00:07.400 --> 00:00:11.400
So now we are going to see how we can remove permissions

2
00:00:10.400 --> 00:00:13.200
 in Linux. All right,

3
00:00:13.200 --> 00:00:17.500
 so in the previous lesson we have seen how to add permissions removing

4
00:00:16.500 --> 00:00:19.800
 permissions is exactly the

5
00:00:19.800 --> 00:00:22.000
 same way. It's very very simple.

6
00:00:22.700 --> 00:00:25.500
So as we can see over here, what are

7
00:00:25.500 --> 00:00:29.100
 the permissions given to the file XYZ we

8
00:00:28.100 --> 00:00:31.700
 can see we have given all the permissions to

9
00:00:31.700 --> 00:00:35.000
 everyone. So let's quickly now remove

10
00:00:34.400 --> 00:00:38.000
 the permissions for others, which

11
00:00:37.300 --> 00:00:39.900
 is oh, right?

12
00:00:41.600 --> 00:00:44.900
So for that we are going to write chord and O

13
00:00:44.900 --> 00:00:48.400
 minus because we need to remove permissions

14
00:00:47.400 --> 00:00:50.700
 this time for others and

15
00:00:50.700 --> 00:00:53.200
 which permissions so let's try to remove

16
00:00:53.200 --> 00:00:56.800
 all the permissions so minus r

17
00:00:56.800 --> 00:01:00.000
 w x and for the file x y

18
00:00:59.500 --> 00:01:03.900
 z. So let's quickly write this chord o

19
00:01:03.900 --> 00:01:06.600
 minus r w x for x

20
00:01:06.600 --> 00:01:09.400
 y z and let's quickly see the permissions now

21
00:01:09.400 --> 00:01:13.900
 and you can see there are three dots

22
00:01:12.900 --> 00:01:15.300
 or three hyphens, which

23
00:01:15.300 --> 00:01:18.900
 basically means that there is no permission

24
00:01:18.900 --> 00:01:22.100
 which has been given to the file XYZ and

25
00:01:21.100 --> 00:01:24.600
 we have successfully removed all

26
00:01:24.600 --> 00:01:28.200
 the permissions of read right and execute.

27
00:01:29.500 --> 00:01:32.800
Now, let's quickly verify this. So let

28
00:01:32.800 --> 00:01:34.900
 me switch user to uremi.

29
00:01:35.400 --> 00:01:38.700
And we have switched the user. Now. Let's

30
00:01:38.700 --> 00:01:42.800
 try to read this file. So cat XYZ and

31
00:01:41.800 --> 00:01:44.300
 according to the permissions that

32
00:01:44.300 --> 00:01:47.400
 we have given we should not be

33
00:01:47.400 --> 00:01:51.100
 able to read the file. So let's try and verify

34
00:01:50.100 --> 00:01:53.500
 this. So let me just press enter and

35
00:01:53.500 --> 00:01:56.300
 let's see. What is the output that we

36
00:01:56.300 --> 00:01:56.300
 get?

37
00:01:57.300 --> 00:02:01.200
And correct. It says permission denied

38
00:02:00.200 --> 00:02:04.100
 because there is no read permission

39
00:02:03.100 --> 00:02:07.500
 which has been given to this file. Perfect. Let's

40
00:02:06.500 --> 00:02:10.000
 try to write it and for

41
00:02:09.300 --> 00:02:12.300
 obvious reasons, we are going to get the same

42
00:02:12.300 --> 00:02:15.600
 error which is permission denied. Let's verify this

43
00:02:15.600 --> 00:02:19.800
 and you can see the error which is permission denied.

44
00:02:18.800 --> 00:02:21.500
 We can neither read

45
00:02:21.500 --> 00:02:22.600
 or write.

46
00:02:23.700 --> 00:02:25.400
Also, we cannot execute it.

47
00:02:26.200 --> 00:02:29.600
Perfect. Let's go back and let's try

48
00:02:29.600 --> 00:02:33.300
 to read the file with the root user and we

49
00:02:32.300 --> 00:02:35.600
 are able to read the file because the

50
00:02:35.600 --> 00:02:38.400
 root user currently has all the

51
00:02:38.400 --> 00:02:41.800
 permissions as we can see over here. So I

52
00:02:41.800 --> 00:02:44.800
 hope you guys understood how you can remove

53
00:02:44.800 --> 00:02:47.700
 permissions for user group

54
00:02:47.700 --> 00:02:49.300
 and others. Thank you.
