1 00:00:02,120 --> 00:00:04,220 Hello and welcome back to this video. 2 00:00:04,460 --> 00:00:11,930 So we have seen about Linux formations, the three people, which is the user group and others to whom 3 00:00:11,930 --> 00:00:13,790 the permissions are given. 4 00:00:14,060 --> 00:00:18,690 Now, let us see in case we want to give some permission to someone. 5 00:00:18,770 --> 00:00:20,090 How do we do that? 6 00:00:20,420 --> 00:00:22,130 So let's quickly see over here. 7 00:00:22,580 --> 00:00:25,040 This is the file, which is X, Y, Z. 8 00:00:25,070 --> 00:00:30,190 And we have seen the permissions which are given to the user, which is read. 9 00:00:30,200 --> 00:00:30,800 Right. 10 00:00:30,830 --> 00:00:36,590 The group which is read and others the permission is given, which is only read. 11 00:00:36,860 --> 00:00:41,850 So let's now give the permission to others of right as well. 12 00:00:41,870 --> 00:00:45,620 So we have to give a permission to others. 13 00:00:45,620 --> 00:00:51,860 So for that we are going to use the command C mod and we need to give the permission to whom? 14 00:00:51,860 --> 00:00:53,060 To others. 15 00:00:53,060 --> 00:00:59,960 So for that we have to press all because we need to give permission to others and we are giving permissions. 16 00:00:59,960 --> 00:01:06,170 So we are going to write a plus in case we need to remove the permission. 17 00:01:06,200 --> 00:01:07,880 Then what should we write? 18 00:01:08,180 --> 00:01:08,930 Right. 19 00:01:08,960 --> 00:01:15,200 We need to add a minus, but in this case we are giving permission. 20 00:01:15,200 --> 00:01:21,110 So we are going to add plus and what permission we need to give of. 21 00:01:21,110 --> 00:01:21,770 Right. 22 00:01:21,770 --> 00:01:25,010 So we are going to use W perfect. 23 00:01:25,160 --> 00:01:28,090 So now this is a very, very simple to understand. 24 00:01:28,100 --> 00:01:30,920 C mode is something that you have to write. 25 00:01:31,160 --> 00:01:33,320 You need to give permission to others. 26 00:01:33,320 --> 00:01:36,200 So all you have to give permission. 27 00:01:36,200 --> 00:01:42,260 So we are adding a permission which is denoted by plus and which permission you are giving. 28 00:01:42,260 --> 00:01:43,790 It is right permission. 29 00:01:43,790 --> 00:01:49,620 So W and the name of the file to which these changes need to be done. 30 00:01:49,640 --> 00:01:51,230 Now this looks perfect. 31 00:01:51,260 --> 00:01:56,120 Now, after we type this command, what is going to happen? 32 00:01:57,510 --> 00:01:59,580 Let's see it onto the terminal. 33 00:01:59,580 --> 00:02:03,150 So see mod and we need to give a permission. 34 00:02:03,150 --> 00:02:14,250 So O plus w and to the file z set and hit enter and the command got executed without any error. 35 00:02:14,280 --> 00:02:16,200 Let's quickly see the permissions now. 36 00:02:16,200 --> 00:02:23,970 And here we can see extra w has been added which cannot be seen over here. 37 00:02:24,210 --> 00:02:32,040 Now this means the permission has been successfully added to the file X, Y, Z, and now the users, 38 00:02:32,340 --> 00:02:36,180 the other users can edit the file as well. 39 00:02:36,360 --> 00:02:42,720 So let's quickly switch user to the user Udemy and now we are Udemy. 40 00:02:42,750 --> 00:02:43,650 Let's verify that. 41 00:02:43,650 --> 00:02:44,460 Who am I? 42 00:02:44,490 --> 00:02:46,560 I'm the user Udemy. 43 00:02:46,560 --> 00:02:49,170 And now we have the right permission as well. 44 00:02:49,170 --> 00:02:51,000 So let's really read first. 45 00:02:51,000 --> 00:02:56,070 So read, get x, y, z and we can see we are able to read it. 46 00:02:56,100 --> 00:03:01,470 Let's quickly modify it using Nano and let's write. 47 00:03:01,470 --> 00:03:10,080 This is modified by Udemy, let's try to save it and we are successfully able to save it. 48 00:03:10,170 --> 00:03:14,190 Let's see if our changes are successfully saved. 49 00:03:14,880 --> 00:03:18,120 And you can see this is modified by Jeremy. 50 00:03:18,150 --> 00:03:19,820 Let's verify again. 51 00:03:19,830 --> 00:03:23,480 Let's try to read this file by the user route. 52 00:03:23,490 --> 00:03:32,190 And yes, we are able to successfully see the changes that has been done into the file by the other 53 00:03:32,190 --> 00:03:34,260 user, which is Udemy. 54 00:03:34,290 --> 00:03:35,010 Perfect. 55 00:03:35,310 --> 00:03:37,980 So now we know how to give permissions. 56 00:03:38,160 --> 00:03:43,920 So I hope you guys understood how you can give permissions to any user. 57 00:03:43,950 --> 00:03:51,480 So in case you want to give permission to a group for that, you're using the symbol G plus which permission 58 00:03:51,480 --> 00:03:54,720 you need to give, read, write, execute and the file name. 59 00:03:54,870 --> 00:03:59,220 Similarly, you want to give some permission to the user who has created the file. 60 00:03:59,220 --> 00:04:02,880 So let's say you plus RW, X and x, y, z. 61 00:04:03,270 --> 00:04:05,340 Let's try to see it over here. 62 00:04:05,370 --> 00:04:11,940 Let's try to see the first the permissions, and let's give all the permissions to the user. 63 00:04:11,940 --> 00:04:19,860 So you plus RW X and the file name, let's see the permission now and you can see, read, write, execute 64 00:04:19,860 --> 00:04:23,430 is the permission which is given to the user. 65 00:04:23,580 --> 00:04:28,020 So now all the permissions are being given to the user. 66 00:04:28,050 --> 00:04:32,280 The group has the right permission and others have RE-ITERATE permission. 67 00:04:32,430 --> 00:04:38,610 Now, in case you want to give all the permissions to everyone, all the three categories of people, 68 00:04:38,700 --> 00:04:47,160 which is the user group and others, for that you simply need to write c mod a a means all and what 69 00:04:47,160 --> 00:04:47,550 permission. 70 00:04:47,550 --> 00:04:50,160 You need to give all the permissions. 71 00:04:50,340 --> 00:04:52,680 So you can do it this way. 72 00:04:52,710 --> 00:04:59,360 Let's try to see the permissions now and you can see RW X, RW X and RW X. 73 00:04:59,370 --> 00:05:04,070 Now all the permissions are given to the user group and others. 74 00:05:04,080 --> 00:05:04,770 Perfect. 75 00:05:05,370 --> 00:05:09,570 Now you must be wondering, what does this hyphen represent? 76 00:05:09,600 --> 00:05:16,850 This basically represents, in this case, nothing that this is a file in case it is a directory. 77 00:05:16,860 --> 00:05:21,390 There would have been a D over there which represents that. 78 00:05:21,390 --> 00:05:24,260 This is a directory and it is not a file. 79 00:05:24,270 --> 00:05:24,960 That's it. 80 00:05:25,140 --> 00:05:26,910 So I hope you guys understood this. 81 00:05:26,910 --> 00:05:33,670 How you can add permissions in the next lesson, we are going to see how you can remove permissions. 82 00:05:33,690 --> 00:05:34,440 Thank you.