I am running a CentOS-7 virtual machine and I have the task of recovering the root password of the system. But the GRUB menu is locked with Password-Based Key Derivation Function 2. Therefore I cannot just press 'e' at the grub menu.

Can anyone help point me in the right direction? I have no clue where to start. Google searches only bring up people talking about pressing 'e' at the GRUB menu which isn't possible here.

  • 1
    Where is this VM running? Is this on your own box (eg running Oracle Virtual box)? or is this running in the cloud (eg aws)? Your easiest way in (if it's not encrypted) might be to reset the root password by accessing the VM image without booting. Or if it's aws, you may be able to get a root console through the aws console. – Philip Couling Dec 29 '19 at 14:13
  • my VM is running on vmware workstation – Ethan Low Jan 1 at 16:32

You can try this:

Download the Super Grub2 Disk ISO and insert the image into your virtual optical drive and boot from it. Choose "Detect and show boot methods" from the menu; Super Grub2 should find your grub.cfg and add the entries to the list of boot options and bypass the password protection. Find the menu entry (scroll a bit down) and press e to edit it.

Follow the instructions on the CentOS wiki page Resetting a Forgotten Root Password (which links to the RedHat documentation).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.