Set the grub2 password in ubuntu12.04

Source: Internet
Author: User

Why do we do this? The packages all know how to directly perform the following operations:

Leekwen @ leekwen :~ # Grub-mkpasswd-pbkdf2Enter password: <enter Your grub password Reenter password here: <enter Your grub password here Your PBKDF2 is grub. pbkdf2.sha512.10000. keystore @ leekwen :~ # Cp/etc/grub. d/00_header/etc/grub. d/00_header.bakleekwen @ leekwen :~ # Vi/etc/grub. d/00_headerleekwen @ leekwen :~ # Tail-n 6/etc/grub. d/00_header ### Add those line to set GRUB2 password cat <EOFset superusers = "leekwen" password_pbkdf2 leekwen grub. pbkdf2.sha512.10000. bc4d0a424e86ee447561fc822c832xxxxxxxxxxxxx45572d3b4e40500ceeof ### Add endleekwen @ leekwen:/etc/grub. d # update-grub <run this command to Generating grub. cfg... found linux image:/boot/vmlinuz-3.11.0-15-genericFound initrd image:/boot/initrd. the img-3.11.0-15-genericFound memtest86 + image:/memtest86 +. bindone
In this way, after the restart, when you press e for the startup Item, you will be asked to enter:
username:password:
Only after the user name (for example, the user name I just set is: leekwen) and the password is correct (the password just generated with the grub-mkpasswd-pbkdf2) can enter the edit menu of the startup Item, this step is safe. Remember to run the "update-grub" command after modifying the 00_header so that it will take effect !!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.