Quantcast
Channel: Active questions tagged password - Ask Ubuntu
Viewing all articles
Browse latest Browse all 330

Avoid Grub2 password protect on every boot?

$
0
0

I have set Grub2 password following this thread. It works fine but now it prompts for username and password every time I start or restart my computer. It's actually the first thing it does.

Now, if the Grub config files get corrupted for some reason, I'm basically locked out of accessing anything. What I want is to have options, to be able to access my desktop and edit the config files without being Grub blocked, in case something goes wrong, but still have a password prompt when pressing shift key to access Grub menu.

This is how my 40_custom file looks like:

#!/bin/shexec tail -n +3 $0set superusers="xxx"password_pbkdf2 xxx hashed_password

I also looked into this thread where a similar question was asked and answered but the method was slightly different and it was for older versions of Ubuntu. I would gladly try out the solutions but I really don't want to mess things up and lock myself out.

So is there a safe way to achieve this? Would editing /etc/grub.d/10_linux suffice?

Thanks for your answers in advance.

UPDATE:

So I decided to try out the solution above and it worked but not without slight adjustments. I modified the /etc/grub.d/10_linux, added --unrestricted to the line 132:

echo "menuentry '$(echo "$os" | grub_quote)' --unrestricted ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"

Note that you shouldn't make any changes to the line 130 above that says '$(echo "$title" | grub_quote)' or you won't be able to access Grub menu by pressing shift key from the boot. At least I was not able to.

After running sudo update-grub and restarting it will go straight past Grub, giving the desired effect. On the other hand, if the Grub menu is called upon, it will show the menu but whenever trying to hit any of the advanced options, including console and edit, it will prompt for username and password.

Hopefully, this will help someone in the same situation.


Viewing all articles
Browse latest Browse all 330

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>