Step3:
Change the following in /etc/grub.d/20_memtest to password protect the memtest86+ option:from:

menuentry "Memory test (memtest86+)" {

to:

menuentry "Memory test (memtest86+)" --users myname {

Additional memtest86+ entries (from other partitions) may also be located in this file. The line will start with “menuentry”. Change these lines as desired.Step4:
Change the following in /etc/grub.d/30_osprober to password protect kernels/operating systems on other partitions.Look for any line in /etc/grub.d/30_osprober which begins with “menuentry”.

menuentry "${LONGNAME} (on ${DEVICE})" {

menuentry "${LLABEL} (on ${DEVICE})" {

Make the change as described in previous step.Step5:
Finally,requiring a password for every menuentry in a file can be added using the following command: