How to set the Grub2 password in Ubuntu

Source: Internet
Author: User

Grub is a boot loader from the GNU project, an implementation of the multi-boot specification, which allows users to have multiple operating systems in the computer at the same time and select the operating system that they want to run when the computer starts. In the Ubuntu system, many users will set the password for GRUB2, but how to do? The following small series to introduce the next Ubuntu set up Grub2 password method.

  Operation Steps:

leekwen@leekwen:~# GRUB-MKPASSWD-PBKDF2

Enter password: "Input your grub password here."

Reenter password: "Enter your grub password here."

Your PBKDF2 is GRUB.PBKDF2.SHA512.10000.BC4D0A450E86EE447561FC822C832XXXXXXXXXXXXX45572D3B4E40500CE

leekwen@leekwen:~# Cp/etc/grub.d/00_header/etc/grub.d/00_header.bak

leekwen@leekwen:~# Vi/etc/grub.d/00_header

leekwen@leekwen:~# Tail-n 6/etc/grub.d/00_header

### ADD Those line to set GRUB2 password

Cat "EOF

Set superusers= "Leekwen"

PASSWORD_PBKDF2 Leekwen GRUB.PBKDF2.SHA512.10000.BC4D0A450E86EE447561FC822C832XXXXXXXXXXXXX45572D3B4E40500CE

Eof

### ADD End

leekwen@leekwen:/etc/grub.d# Update-grub "Run this command before it can take effect

Generating grub.cfg ...

Found Linux Image:/boot/vmlinuz-3.11.0-15-generic

Found initrd Image:/boot/initrd.img-3.11.0-15-generic

Found memtest86+ Image:/memtest86+.bin

Done

After this reboot, when the startup item is pressed, E will let you enter:

Username

Password

Only the user name (for example, I just set the username: Leekwen) and the password after the correct (just use the GRUB-MKPASSWD-PBKDF2 generated password), you can enter the Startup item Edit menu, startup item This step is safe, remember, modify 00_header must run after "Update-grub" command, so as to 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.