Hack and Reset Linux Grub Password in Easy Way
Today was rough day for me, because i've been asked how to hack and reset linux grub password. As we all ready know that GRUB (GRand Unified Bootloader) is the boot loader of linux and the analogy of it is like a "bridge" that connect BIOS Startup (Including power on-self test) to Operating system. So when the linux grub is protected by password, we must enter the password to make it boot into the hard drive and run the linux system. If not, we are unable to proceed to the OS itself. That's very dangerous if we forgot the password. But don't worry, I have figured out how to hack and reset linux grub password so we can logging back in.
How To Hack and Reset Linux Grub Password :
- We must create the bootable USB disk with linux inside. For my previous case, i am using Linux Mint because it has clear GUI interface for easy search;
- After we have bootable USB disk, boot into it;
- Select Boot to live CD;
- Then wait until the desktop appears;
- Open Computer > Your Linux Installation Partition;
- First thing first, we need to find boot.cfg file because it contains the password of your GRUB by heading to folder boot > grub. Your boot.cfg file will appear there;
- Open Terminal in Linux Mint, and type sudo su. This means, you are activating super user command which is able to modify things.
- Type cd in your terminal and now in the file explorer, drag the boot.cfg into terminal. Terminal will be automatically type the folder direction to boot.cfg. it will be looked like this :
cd <space> /boot/grub/boot.cfg
Now, you need to press enter. - Terminal will open the lines of text, that is fine. Don't worry. Now, search for word "set superusers". it will be looked like this :set superusers="username"password_pbkdf2 username grub.pbkdf2.sha512.1000.83G7F2I2GF2FG26FG2U6DG2IHFOF2O8HF23O8FH2O38H### END /etc/grub.d/00_header ###
- The line above is the username and the password of GRUB but it is encrypted. You can decrypt that if you want, but i prefer to reset it because it is not much wasting time rather than decrypting. All we need to do is just add the # (hash symbol) in front of that lines. The Linux will read that code as a comment so it will not be executed. After you add the symbol, it should looked like this :#set superusers="username"#password_pbkdf2 username #grub.pbkdf2.sha512.1000.83G7F2I2GF2FG26FG2U6DG2IHFOF2O8HF23O8FH2O38H### END /etc/grub.d/00_header ###
- Press CTRL + X at the same time and proceed with pressing Y. It will save the boot.cfg;
- Now, we need to go to 00_header file and remove some lines too. Type cd in terminal, and in the file explorer head to folder etc > grub.d > 00_header. Do the same thing by dropping it to terminal like previous step.
- Text editor will be opened, you scroll through the bottom of the page and find these lines :cat << EOFset superusers = "username"password_pbkdf2 username grub.pbkdf2.sha512.1000.83G7F2I2GF2FG26FG2U6DG2IHFOF2O8HF23O8FH2O38HEOFAdd the same # symbol like the previous edit in boot.cfg files.
#cat << EOF
#set superusers = "username"#password_pbkdf2 username #grub.pbkdf2.sha512.1000.83G7F2I2GF2FG26FG2U6DG2IHFOF2O8HF23O8FH2O38H#EOF - After that, press CTRL + X at the same time and proceed with pressing Y. It will save the 00_header file;
- Now try to reboot to Linux, it should not asked the grub password.