The grub2 boot loader should have a superuser account and password
protection enabled to protect boot-time settings.
Since plaintext passwords are a security risk, generate a hash for the password
by running the following command: # grub2-mkpasswd-pbkdf2
When prompted, enter the password that was selected.
Using the hash from the output, modify the /etc/grub.d/40_custom
file with the following content:
set superusers="root"
password_pbkdf2 boot grub.pbkdf2.sha512.VeryLongString
Once the superuser password has been added, update the
grub.cfg
file by running:
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg