I am running Lubuntu 18.04(updated to latest kernel 5.0.0-36-generic) as the only operating system on my laptop.

I tried setting a grub bootloader password following the guide here https://help.ubuntu.com/community/Grub2/Passwords

I modified the 40_custom file in


like this:

sudo gedit   /etc/grub.d/40_custom

set superusers="tom"

password tom somepasswordhere /* I did not use grub-mkpasswd-pbkdf2 */

sudo update-grub

The last command ran succesfully. So I restarted the system and a prompt appears:

error:can't find command 'hwmatch'.

Enter Username: tom

Enter Password: somepasswordhere

But the password/username does not work:

error access denied.

 Failed to boot both default and fallback entries.

Press any key to continue.

I need some clarifications:

  1. Should the user name I select is to be random or the one I used to install Lubuntu/root/login username/any thing else ?

  2. Is the bug

error:can't find command 'hwmatch'

causing this ?

  1. Any keyboard settings causing this ?

I am fairly certain that I am typing the correct password(numlock,capslock etc.) at the prompt. Please note that in 18.04 the above method also protects any submenu in grub. So pressing "c","e" won't work.

  • 2
    What do you mean by the latest kernel? A supported Ubuntu kernel? or an upstream kernel without Ubuntu patches? The latest Ubuntu 18.04 non-HWE (4.15) kernel? or Ubuntu 18.04 HWE kernel? Please be specific as latest doesn't tell us much. Also useful is if you're using english keyboard & language; as the installer has Ubuntu language support active; but when rebooted to grub it's not running so keyboard layout can differ if not using english (US/UK etc) keyboards, esp. if you made changes over the default tested setup. – guiverc Nov 25 at 3:44
  • when I ran uname -r I think it gave something like 5.0.0-36-generic. I am using english keyboard but US/UK/...,I don't remember. What characters in the password will be affected? I only used lowercase,uppercase letters,numbers and "*" and "#". – Tanmap Nov 25 at 3:55
  • 1
    The issue I was referring to won't be an issue with any US/UK/english keyboard. As booted it's the machine BIOS/EUFI/firmware that controls the keyboard that has a far more limited set of characters than UTF allows once OS is fully booted. Nearly every make of box has a US/english designed firmware that copes with english fine, but not extra non-latin characters found in say russian etc. I'll aim to return here later today & try and evaluate what you did & see if something occurs to me – guiverc Nov 25 at 4:11
  • 1
    This is a guess; but try adding a insmod hwmatch (insert module) to your currently used boot entry in grub.cfg (I'd edit it directly; if it works you can do it properly so it survives an update-grub; if it fails use update-grub to restore it back to normal). My Lubuntu 18.04 has hwatch.mod already, so I'd add it after the insmod gzip.mod – guiverc Nov 25 at 10:43

Your Answer

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

Browse other questions tagged or ask your own question.