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,879
to remember what you want to do.

9
00:00:30,879 --> 00:00:33,520
And honestly, if you don't remember,

10
00:00:33,520 --> 00:00:35,520
just give it to visudo.

11
00:00:35,520 --> 00:00:38,320
And I would advise to look for wheel.

12
00:00:38,320 --> 00:00:41,639
Here, this line wheel is a nice placeholder.

13
00:00:41,639 --> 00:00:44,400
And I like to copy it over and edit it

14
00:00:44,400 --> 00:00:48,720
so that I don't have to make any syntax errors in the file

15
00:00:48,720 --> 00:00:50,959
that I'm going to create.

16
00:00:50,959 --> 00:00:53,520
Now, of course, we are not going to do this for wheel.

17
00:00:53,520 --> 00:00:57,439
But we have the placeholder of what is needed.

18
00:00:57,439 --> 00:01:02,840
And in this placeholder, I'm going to add user ana.

19
00:01:02,840 --> 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,040
root.

23
00:01:16,040 --> 00:01:18,559
Did you notice the order, by the way?

24
00:01:18,559 --> 00:01:21,519
Normally, you go from specific to generic.

25
00:01:21,519 --> 00:01:23,839
Here, you go from generic to specific.

26
00:01:23,839 --> 00:01:26,000
So you have the generic definition

27
00:01:26,000 --> 00:01:28,800
that the user can use user bin passwd,

28
00:01:28,800 --> 00:01:32,440
but not 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,239 --> 00:01:56,519
And I'm not sure about it.

36
00:01:56,519 --> 00:01:59,360
Let's create a user, user add ana.

37
00:01:59,360 --> 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,360
minus s for bin bash as a shell, and minus u

40
00:02:08,360 --> 00:02:13,520
if you want to give the user a user ID as well on user ana.

41
00:02:13,520 --> 00:02:16,240
Yes, on Linux Plus, you need to be aware of command line

42
00:02:16,240 --> 00:02:17,880
options like this, so it never hurts

43
00:02:17,880 --> 00:02:20,000
to show you how to use them.

44
00:02:20,000 --> 00:02:20,520
Good.

45
00:02:20,520 --> 00:02:22,320
Next, I'm going to set a password,

46
00:02:22,320 --> 00:02:25,199
so passwd for user ana.

47
00:02:25,199 --> 00:02:28,639
Going once and going twice.

48
00:02:28,639 --> 00:02:31,960
And now I can open a subshell as user ana

49
00:02:31,960 --> 00:02:36,559
and use sudo passwd linda.

50
00:02:36,559 --> 00:02:39,880
And ana is entering the password and is

51
00:02:39,880 --> 00:02:44,520
prompted for a new password, so that is working out all right.

52
00:02:44,520 --> 00:02:48,360
And that is what needed to be done in this lab.

53
00:02:48,360 --> 00:02:48,919
That's all.

54
00:02:48,919 --> 00:02:51,479
Let's continue with lesson two.

