1 00:00:01,170 --> 00:00:02,370 Hey, welcome back. 2 00:00:02,940 --> 00:00:08,130 So now we are going to see how we can remove permissions in Linux. 3 00:00:08,430 --> 00:00:08,850 All right. 4 00:00:08,850 --> 00:00:12,030 So in the previous lesson, we have seen how to add permissions. 5 00:00:12,390 --> 00:00:16,190 Removing permissions is exactly the same way. 6 00:00:16,200 --> 00:00:17,850 It's very, very simple. 7 00:00:18,090 --> 00:00:22,950 So as we can see over here, what are the permissions given to the file? 8 00:00:22,980 --> 00:00:24,180 X, Y, Z. 9 00:00:24,330 --> 00:00:28,350 We can see we have given all the permissions to everyone. 10 00:00:28,350 --> 00:00:34,350 So let's quickly now remove the permissions for others, which is. 11 00:00:34,350 --> 00:00:36,000 Oh, right. 12 00:00:36,930 --> 00:00:44,820 So for that, we are going to write C mod and O minus because we need to remove permissions this time 13 00:00:44,820 --> 00:00:47,410 for others and which permissions. 14 00:00:47,430 --> 00:00:50,220 So let's try to remove all the permissions. 15 00:00:50,310 --> 00:00:56,190 So minus W, X and for the file X, Y, Z. 16 00:00:56,220 --> 00:01:02,970 So let's quickly write this C mod or minus r w, x for x, y, z. 17 00:01:03,060 --> 00:01:05,310 And let's quickly see the permissions now. 18 00:01:05,520 --> 00:01:14,550 And you can see there are three dots or three hyphens, which basically means that there is no permission 19 00:01:14,550 --> 00:01:17,220 which has been given to the file X, Y, Z. 20 00:01:17,370 --> 00:01:24,000 And we have successfully removed all the permissions of read, write and execute. 21 00:01:25,050 --> 00:01:27,630 Now let's quickly verify this. 22 00:01:27,630 --> 00:01:33,300 So let me switch user to Udemy and we have switched the user. 23 00:01:33,690 --> 00:01:35,790 Now let's try to read this file. 24 00:01:35,790 --> 00:01:44,220 So Cat X, Y, Z, and according to the permissions that we have given, we should not be able to read 25 00:01:44,220 --> 00:01:44,820 the file. 26 00:01:44,820 --> 00:01:47,040 So let's try and verify this. 27 00:01:47,130 --> 00:01:54,360 So let me just press enter and let's see what is the output that we get and correct. 28 00:01:54,480 --> 00:02:01,710 It says permission denied because there is no read permission which has been given to this file. 29 00:02:02,070 --> 00:02:02,790 Perfect. 30 00:02:02,820 --> 00:02:04,560 Let's try to write it. 31 00:02:04,560 --> 00:02:10,240 And for obvious reasons, we are going to get the same error, which is permission denied. 32 00:02:10,260 --> 00:02:15,500 Let's verify this and you can see the error, which is permission denied. 33 00:02:15,510 --> 00:02:18,660 We can neither read or write. 34 00:02:19,290 --> 00:02:21,270 Also, we cannot execute it. 35 00:02:21,810 --> 00:02:22,450 Perfect. 36 00:02:22,470 --> 00:02:27,630 Let's go back and let's try to read the file with the root user. 37 00:02:27,720 --> 00:02:35,850 And we are able to read the file because the root user currently has all the permissions, as we can 38 00:02:35,850 --> 00:02:36,780 see over here. 39 00:02:36,930 --> 00:02:44,490 So I hope you guys understood how you can remove permissions for user group and others. 40 00:02:44,520 --> 00:02:45,240 Thank you.