Linux grub, is actually the BOOT MENU of the system.
The goal of the grub, is to give you an information to where the system aiming for at the boot.
Grub, is the new code name of this menu, the older name was: LILO (linux loader).
The big advantage of Linux Grub is that you can secure it.
Follow this steps to secure your Grub by UserName & Password.
#1) Open terminal & type:
assault@kalivm:~$ sudo grub-mkpasswd-pbkdf2
#2) Type your password for your grub (any password that you want) [and hit enter].
*You should get this output*
#3) Open a new terminal tab and Type:
assault@kalivm:~$ sudo gedit /etc/grub.d/40_custom
Let’s start a new line and write down the follow content.
in this line, we will copy the hash [and hit enter]
The UserName that i picked up is tux. And it should look like this:
#4) Save and close the gedit file.
#5) In the terminal type:
assault@kalivm:~$ sudo update-grub.
assault@kalivm:~$ sudo reboot
*When your system is booting up, you should get this*
BE CAREFUL! Please make sure that you are not making any mistakes during the process.
A one simple mistake, even in one word, can get you locked out of your grub. BE AWARE!
Here is an example by Gamer Forever:
Ohh wait…………!!! Have you get yourself locked out of your grub? No Problem 🙂
[HOW TO UNLOCK THE GRUB]
#1) Run your Kali live CD, and boot into the live (amd64)
#2) Open terminal & type 1 by 1
root@kali:~# mount /dev/sda1 /mnt
*I believe that your main OS installed on sda1, you can check this by the command: fdisk -l*
root@kali:~# cd /mnt
root@kali:~# cd etc
root@kali:~# cd grub.d
root@kali:~# cat 40_custom
*To view your grub file with the username and the password*
root@kali:~# gedit 40_custom
*Now delete the whole password content. It should looks like this after the re-edit*
exec tail -n +3 $0
#This file provide an easy way to add custom menu entries. Simple type the
#menu entries your want to add after this comment. Be careful not to change
#the ‘exec tail’ line above.
#3) Save & close the 40_custom file.
#3) Open another terminal and type 1 by 1
root@kali:~# mount –bind /dev /mnt/dev
root@kali:~# mount –bind /sys /mnt/sys
root@kali:~# mount –bind /proc /mnt/proc
root@kali:~# chroot /mnt
REBOOT YOUR MACHINE and REMOVE THE LIVE CD