0

How to set password for grub bootloader on Ubuntu?

αғsнιη
  • 35,660

1 Answers1

0

Username and password are added to the /etc/grub.d/40_custom file. Use your favorite editor and add the following line:

password <<username>> <<password>>

Example:

password john johnP123

If you want to add a hashed password, use the *grub-mkpasswd-pbkdf2 utility to generate a hashed password. Add this hashed password to the /etc/grub.d/40_custom file like this:

password_pbkdf2 <<username>> <<hashed-passwd>>

Save the file and run sudo update-grub.

muru
  • 197,895
  • 55
  • 485
  • 740