WEBVTT - This file was automatically generated by VIMEO

0
00:00:05.400 --> 00:00:07.900
Hello everyone and welcome to this lesson.

1
00:00:08.900 --> 00:00:11.200
So in the previous lesson, we saw

2
00:00:11.200 --> 00:00:14.800
 that how we can reset the root password or

3
00:00:14.800 --> 00:00:17.900
 any other uses password directly from

4
00:00:17.900 --> 00:00:18.700
 the grub menu.

5
00:00:19.500 --> 00:00:22.400
Now you may be thinking that if someone has a

6
00:00:22.400 --> 00:00:26.100
 physical access to your computer or your device, they

7
00:00:25.100 --> 00:00:28.400
 could possibly reset your password and

8
00:00:28.400 --> 00:00:29.600
 get into your computer.

9
00:00:31.200 --> 00:00:34.400
And you must be thinking they should be an additional layer

10
00:00:34.400 --> 00:00:37.500
 of security that he or she

11
00:00:37.500 --> 00:00:39.000
 or maybe any attacker.

12
00:00:39.600 --> 00:00:42.400
Or a third party person should not be able

13
00:00:42.400 --> 00:00:45.500
 to access the grub menu and

14
00:00:45.500 --> 00:00:47.200
 modify those entries.

15
00:00:48.100 --> 00:00:51.900
So for that, we have a solution we can basically put

16
00:00:51.900 --> 00:00:54.500
 a password or lock our grub itself.

17
00:00:55.300 --> 00:00:58.300
So in this lesson, you're going to see how you can

18
00:00:58.300 --> 00:01:02.200
 keep an additional layer of security by making

19
00:01:01.200 --> 00:01:04.700
 a password for the grub, which

20
00:01:04.700 --> 00:01:07.200
 is basically protecting it so it will

21
00:01:07.200 --> 00:01:10.600
 be a two-factor authentication for you. That is

22
00:01:10.600 --> 00:01:12.700
 whenever you need to start your computer.

23
00:01:13.700 --> 00:01:16.500
You need to give the authentication that

24
00:01:16.500 --> 00:01:19.600
 is the correct username and password for the grub. And

25
00:01:19.600 --> 00:01:22.000
 then the final login screen, which is

26
00:01:22.100 --> 00:01:25.800
 the user login that is root and the password. So let's

27
00:01:25.800 --> 00:01:28.400
 see this how to set up a grub

28
00:01:28.400 --> 00:01:30.700
 based authentication mechanism.

29
00:01:32.500 --> 00:01:35.900
So first, I'm going to open up my terminal as

30
00:01:35.900 --> 00:01:38.300
 you can see over here and in the

31
00:01:38.300 --> 00:01:41.300
 terminal first, let's verify which

32
00:01:41.300 --> 00:01:44.700
 is the user currently logged in so I am root.

33
00:01:45.400 --> 00:01:48.100
These are the steps to set up the grub password.

34
00:01:49.200 --> 00:01:53.600
The first step is to generate encrypted hash

35
00:01:52.600 --> 00:01:55.300
 value. So for

36
00:01:55.300 --> 00:01:58.900
 that the command is grub make password

37
00:01:58.900 --> 00:02:02.700
 in the format, which is pbkdf2.

38
00:02:03.200 --> 00:02:07.600
Now if you're not aware about what what is pbk df2

39
00:02:06.600 --> 00:02:10.200
 then it is basically a

40
00:02:09.200 --> 00:02:11.700
 hashing algorithm.

41
00:02:12.500 --> 00:02:15.200
So it applies a pseudo random function

42
00:02:15.200 --> 00:02:18.900
 such as a hash based message authentication

43
00:02:18.900 --> 00:02:21.400
 code, which is hmac to the

44
00:02:21.400 --> 00:02:24.000
 input password or passphrase that we are going to

45
00:02:24.400 --> 00:02:27.200
 provide there is let's say my password is going

46
00:02:27.200 --> 00:02:27.700
 to be root.

47
00:02:28.300 --> 00:02:31.900
With assault value which is random and repeats

48
00:02:31.900 --> 00:02:34.500
 the process many times to produce a

49
00:02:34.500 --> 00:02:37.500
 derived key, which is basically secure.

50
00:02:38.200 --> 00:02:41.600
Now it utilizes that specific key

51
00:02:41.600 --> 00:02:44.700
 for further subsequent operations or

52
00:02:44.700 --> 00:02:47.700
 other actions wherein it needs to

53
00:02:47.700 --> 00:02:50.400
 provide the authentication. So, let's

54
00:02:50.400 --> 00:02:52.000
 see this how it actually works.

55
00:02:53.500 --> 00:02:56.500
So I need to type this command and hit enter

56
00:02:56.500 --> 00:02:59.900
 now. This is asking for the password or

57
00:02:59.900 --> 00:03:02.000
 passphrase that you need to provide.

58
00:03:03.200 --> 00:03:06.600
As you can see over here. I have provided my password as

59
00:03:06.600 --> 00:03:10.000
 root and it has generated successfully a

60
00:03:09.300 --> 00:03:12.500
 hash of my password as can

61
00:03:12.500 --> 00:03:13.400
 be seen onto the screen.

62
00:03:14.400 --> 00:03:17.400
Alright, so we have successfully generated the hash

63
00:03:17.400 --> 00:03:20.700
 for my password using the cryptographic algorithm,

64
00:03:20.700 --> 00:03:23.000
 which is PB kdf2.

65
00:03:24.500 --> 00:03:27.200
Quickly, let's open up a new terminal window.

66
00:03:28.100 --> 00:03:31.200
And now in the new terminal window what we are

67
00:03:31.200 --> 00:03:34.800
 going to do is we are going to modify a file which

68
00:03:34.800 --> 00:03:36.300
 is 40 custom.

69
00:03:37.400 --> 00:03:40.200
What is the reason to modify this file? You will come to

70
00:03:40.200 --> 00:03:43.400
 know in just few seconds. So let's first go into the

71
00:03:43.400 --> 00:03:46.400
 directory of grub, which is under the

72
00:03:46.400 --> 00:03:47.900
 EDC home directory.

73
00:03:49.100 --> 00:03:50.200
Once we are over here.

74
00:03:50.900 --> 00:03:53.300
We will quickly create a backup file of this

75
00:03:53.300 --> 00:03:56.400
 40 underscore custom file in case

76
00:03:56.400 --> 00:03:59.300
 anything goes wrong. We can roll back

77
00:03:59.300 --> 00:04:00.100
 all our changes.

78
00:04:00.900 --> 00:04:03.600
Now once you are into this file, you need

79
00:04:03.600 --> 00:04:06.200
 to modify this so you can use Nano or

80
00:04:06.200 --> 00:04:08.400
 Vim. I'm using currently Nano.

81
00:04:09.500 --> 00:04:12.500
This is basically the configuration file which is

82
00:04:12.500 --> 00:04:15.500
 required to give instructions that

83
00:04:15.500 --> 00:04:19.100
 we need to set up a username password into

84
00:04:18.100 --> 00:04:20.400
 our grub.

85
00:04:21.300 --> 00:04:24.200
You already generated a hash and we will now

86
00:04:24.200 --> 00:04:27.600
 use that hash as password while we

87
00:04:27.600 --> 00:04:30.300
 log in into the machine at the grub screen

88
00:04:30.300 --> 00:04:33.500
 so you can specify the name of

89
00:04:33.500 --> 00:04:36.500
 the user over here. So I'm specifying the

90
00:04:36.500 --> 00:04:39.700
 root user because I want to authenticate as the

91
00:04:39.700 --> 00:04:40.700
 root user.

92
00:04:41.300 --> 00:04:44.300
So set super users as root and the password.

93
00:04:45.200 --> 00:04:48.900
So password underscore pbkdf to

94
00:04:48.900 --> 00:04:51.500
 the username once more that is root and

95
00:04:51.500 --> 00:04:54.700
 the hash here. This is basically the hash

96
00:04:54.700 --> 00:04:57.600
 that we have generated in the previous step, which

97
00:04:57.600 --> 00:05:00.400
 is this you need to keep in mind that you

98
00:05:00.400 --> 00:05:02.300
 need to copy the hash from

99
00:05:03.300 --> 00:05:06.800
Your password is after that string

100
00:05:06.800 --> 00:05:09.200
 complete and Grub dot start.

101
00:05:09.200 --> 00:05:13.000
 You need to copy that which is highlighted currently onto

102
00:05:12.100 --> 00:05:13.900
 the left terminal.

103
00:05:14.800 --> 00:05:17.500
So I'll just copy this quickly and you

104
00:05:17.500 --> 00:05:20.700
 need to paste it over here. I already have

105
00:05:20.700 --> 00:05:23.300
 a older hash which I will remove

106
00:05:23.300 --> 00:05:26.500
 and I'll replace it with the new hash that

107
00:05:26.500 --> 00:05:28.300
 we have generated recently.

108
00:05:41.500 --> 00:05:44.600
So we have successfully deleted the old hash and

109
00:05:44.600 --> 00:05:48.300
 replaced it with a new hash value looks perfect.

110
00:05:47.300 --> 00:05:50.300
 Now we are going to save this file.

111
00:05:51.600 --> 00:05:54.600
This hash and the new hash is

112
00:05:54.600 --> 00:05:57.400
 exactly the same. So we need to save that file.

113
00:05:57.400 --> 00:06:01.000
 So we'll quickly just say control s

114
00:06:00.400 --> 00:06:02.800
 and will come out of the file.

115
00:06:04.400 --> 00:06:08.000
The next step is to make config. So

116
00:06:07.100 --> 00:06:10.700
 we are going to give this command which is grub make

117
00:06:10.700 --> 00:06:13.700
 config hyphen o the configuration file

118
00:06:13.700 --> 00:06:14.700
 of grub.

119
00:06:15.800 --> 00:06:19.200
By doing this command grub will automatically verify

120
00:06:18.200 --> 00:06:21.400
 that whatever changes that we have done in

121
00:06:21.400 --> 00:06:24.100
 the configuration file are correct or no?

122
00:06:24.700 --> 00:06:27.300
It will also try to load the new changes

123
00:06:27.300 --> 00:06:30.900
 that we have created in the 40

124
00:06:30.900 --> 00:06:32.200
 underscore custom file.

125
00:06:33.200 --> 00:06:36.400
You can see it verified. Everything was correct. So now

126
00:06:36.400 --> 00:06:39.500
 we are going to do a restart onto the computer. So we

127
00:06:39.500 --> 00:06:41.400
 have used the command that is in at 6.

128
00:06:42.200 --> 00:06:45.400
You can see the computer is going to boot in four seconds

129
00:06:45.400 --> 00:06:48.900
 as can be seen over here and it will present us a

130
00:06:48.900 --> 00:06:49.900
 grub menu.

131
00:06:51.300 --> 00:06:54.900
Now previously, it used to just load

132
00:06:54.900 --> 00:06:57.600
 the grub menu and start the

133
00:06:57.600 --> 00:07:00.600
 Kali Linux machine where it would ask

134
00:07:00.600 --> 00:07:01.800
 the username and password.

135
00:07:03.100 --> 00:07:06.600
But now here you can see it is asking a username

136
00:07:06.600 --> 00:07:10.400
 and password at the grub screen itself. Now

137
00:07:09.400 --> 00:07:12.900
 we need to give the correct username and

138
00:07:12.900 --> 00:07:16.000
 password to the grub screen to verify that.

139
00:07:15.500 --> 00:07:18.500
 Yes, we have the access to modify

140
00:07:18.500 --> 00:07:21.500
 changes into this machine or the grub

141
00:07:21.500 --> 00:07:22.500
 entry as well.

142
00:07:23.400 --> 00:07:26.800
Once we verify this correctly this computer will

143
00:07:26.800 --> 00:07:29.600
 now start and will present

144
00:07:29.600 --> 00:07:32.500
 a new login screen for us, which is basically

145
00:07:32.500 --> 00:07:35.400
 the user login to which we

146
00:07:35.400 --> 00:07:36.300
 want to login.

147
00:07:37.700 --> 00:07:40.500
So I have provided the correct username and

148
00:07:40.500 --> 00:07:43.500
 password for the grub menu, which was root and

149
00:07:43.500 --> 00:07:44.700
 root and hit enter.

150
00:07:45.600 --> 00:07:48.900
Now you can see the famous Kali theme

151
00:07:48.900 --> 00:07:51.600
 logo has successfully loaded and here

152
00:07:51.600 --> 00:07:52.600
 I need to login.

153
00:07:53.500 --> 00:07:56.600
So I will use my username password which is root and

154
00:07:56.600 --> 00:07:58.300
 ABCD and hit enter.

155
00:07:59.100 --> 00:08:02.300
You can successfully verify I have successfully logged in into

156
00:08:02.300 --> 00:08:05.300
 my computer. So this is it for this lesson. I hope

157
00:08:05.300 --> 00:08:08.600
 you guys understood how you can configure a grab

158
00:08:08.600 --> 00:08:10.400
 password for your computer. Thank you.
