Skip to content Skip to sidebar Skip to footer

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 :

  1. 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;

  2. After we have bootable USB disk, boot into it;

  3. Select Boot to live CD; 

  4. Then wait until the desktop appears;

  5. Open Computer > Your Linux Installation Partition;

  6. 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;

  7. Open Terminal in Linux Mint, and type sudo su. This means, you are activating super user command which is able to modify things.

  8. 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.

  9. 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 ###

  10. 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 ###

  11. Press CTRL + X at the same time and proceed with pressing Y. It will save the boot.cfg;

  12. 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.

  13. Text editor will be opened, you scroll through the bottom of the page and find these lines :
    cat << EOF
    set superusers = "username"
    password_pbkdf2 username grub.pbkdf2.sha512.1000.83G7F2I2GF2FG26FG2U6DG2IHFOF2O8HF23O8FH2O38H
    EOF
    Add 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
  14. After that, press CTRL + X at the same time and proceed with pressing Y. It will save the 00_header file;

  15. Now try to reboot to Linux, it should not asked the grub password.