1 00:00:00,000 --> 00:00:07,080 All right. 2 00:00:07,080 --> 00:00:08,160 Lab solution. 3 00:00:08,160 --> 00:00:09,800 So where am I going to start? 4 00:00:09,800 --> 00:00:14,360 I'm starting with the sudo shell. 5 00:00:14,360 --> 00:00:23,799 And in the sudo shell, I'm going to add etc sudoers.d.ana. 6 00:00:23,799 --> 00:00:26,559 And what am I going to put in this NFL? 7 00:00:26,559 --> 00:00:28,480 Well, this is the part where you need 8 00:00:28,480 --> 00:00:30,799 to remember what you want to do. 9 00:00:30,799 --> 00:00:33,520 And honestly, if you don't remember, 10 00:00:33,520 --> 00:00:35,439 just give it to visudo. 11 00:00:35,439 --> 00:00:38,320 And I would advise you look for wheel. 12 00:00:38,320 --> 00:00:41,560 Here, this line wheel is a nice placeholder. 13 00:00:41,560 --> 00:00:44,439 And I like to copy it over and edit it 14 00:00:44,439 --> 00:00:48,759 so that I don't have to make any syntax errors in the file 15 00:00:48,759 --> 00:00:50,880 that I'm going to create. 16 00:00:50,880 --> 00:00:53,520 Now, of course, we are not going to do this for wheel. 17 00:00:53,520 --> 00:00:57,360 But we have the placeholder of what is needed. 18 00:00:57,360 --> 00:01:02,759 And in this placeholder, I'm going to add user ana. 19 00:01:02,759 --> 00:01:04,199 And all is all. 20 00:01:04,199 --> 00:01:05,760 Well, what can she do? 21 00:01:05,760 --> 00:01:15,040 Well, she can use user bin passwd and not user bin passwd 22 00:01:15,040 --> 00:01:16,000 root. 23 00:01:16,000 --> 00:01:18,519 Did you notice the order, by the way? 24 00:01:18,519 --> 00:01:21,480 Normally, you go from specific to generic. 25 00:01:21,480 --> 00:01:23,919 Here, you go from generic to specific. 26 00:01:23,919 --> 00:01:26,000 So you have the generic definition 27 00:01:26,000 --> 00:01:29,680 that the user can use user bin passwd but not 28 00:01:29,680 --> 00:01:32,440 user bin passwd root. 29 00:01:32,440 --> 00:01:34,959 If you inverse the order of these lines, 30 00:01:34,959 --> 00:01:37,400 it's not going to work. 31 00:01:37,400 --> 00:01:49,839 Then, sudo edit but not sudo edit of etc sudoers. 32 00:01:49,839 --> 00:01:52,120 And that should be doing it. 33 00:01:52,120 --> 00:01:54,000 So of course, you want to test. 34 00:01:54,000 --> 00:01:55,239 Do I even have a user? 35 00:01:55,480 --> 00:01:56,519 I'm not sure about it. 36 00:01:56,519 --> 00:01:59,320 Let's create a user, user add ana. 37 00:01:59,320 --> 00:02:01,120 By the way, if you're on Ubuntu, you 38 00:02:01,120 --> 00:02:04,279 can use user add minus m to make a home directory, 39 00:02:04,279 --> 00:02:08,399 minus s for bin bash as a shell, and minus u 40 00:02:08,399 --> 00:02:13,440 if you want to give the user a user ID as well on user ana. 41 00:02:13,440 --> 00:02:16,279 Yes, on Linux Plus, you need to be aware of command line 42 00:02:16,279 --> 00:02:17,160 options like this. 43 00:02:17,160 --> 00:02:19,960 So it never hurts to show you how to use them. 44 00:02:19,960 --> 00:02:20,440 Good. 45 00:02:20,440 --> 00:02:22,360 Next, I'm going to set a password. 46 00:02:22,360 --> 00:02:25,160 So passwd for user ana. 47 00:02:25,160 --> 00:02:28,600 Going once and going twice. 48 00:02:28,600 --> 00:02:31,919 And now I can open a sub-shell as user ana 49 00:02:31,919 --> 00:02:36,520 and use sudo passwd linda. 50 00:02:36,520 --> 00:02:39,839 And ana is entering the password and is 51 00:02:39,839 --> 00:02:41,440 prompted for a new password. 52 00:02:41,440 --> 00:02:44,479 So that is working out all right. 53 00:02:44,479 --> 00:02:48,320 And that is what needed to be done in this lab. 54 00:02:48,320 --> 00:02:48,880 That's all. 55 00:02:48,880 --> 00:02:51,440 Let's continue with lesson two.