Set Password Protection for Recovery Mode Shell in Ubuntu (GRUB Root Access Security)
Adding a password to the recovery mode shell in Ubuntu involves setting a password for the root user in the recovery mode GRUB menu. Here's how you can do it:
grub-mkpasswd-pbkdf2sudo nano /etc/grub.d/40_custom
**Add a GRUB Menu Entry:** Add the following lines at the end of the file:
set superusers="root"
password_pbkdf2 root GRUB_PASSWORD_HASH
Replace `GRUB_PASSWORD_HASH` with the password hash generated in step 1.sudo update-grubsudo rebootsudo nano /etc/grub.d/40_custom
**Remove the Password Lines:** Delete the lines you added to set the superuser and password. These lines typically look like:
set superusers="root"
password_pbkdf2 root GRUB_PASSWORD_HASH
Remove both the `set superusers` line and the `password_pbkdf2` line.Last updated