Detailed explanation: MD5 encryption method of GRUB in Linux

Source: Internet
Author: User
Tags crypt
Article Title: Detailed explanation: MD5 encryption method of GRUB in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

  1. Use the grub-md5-crypt to generate the md5 password of GRUB;

Through the grub-md5-crypt to add the password GRUB Password calculation, for example, we want to set the grub Password is 123456, so we first use md5 to encrypt the password 123456

[Root @ linux01 beinan] #/sbin/grub-md5-crypt

Password: Enter 123456 here

Retype password: Enter 123456 again

$1 $7uDL20 $ eSB. XRPG2A2Fv8AeH34nZ0

$1 $7uDL20 $ eSB. XRPG2A2Fv8AeH34nZ0 is the value generated after the password is added through the grub-md5-crypt. We need to remember this value, but it is still a bit useful.

  2. Change/etc/grub. conf

For example, the content of my original/etc/grub. conf file is as follows.

Default = 1

Timeout = 10

Splashimage = (hd0, 7)/boot/grub/splash.xpm.gz

Title Fedora Core (2.4.22-1.2061.nptl)

Root (hd0, 7)

Kernel/boot/vmlinuz-2.4.22-1.2061.nptl ro root = LABEL =/

Initrd/boot/initrd-2.4.22-1.2061.nptl.img

Title WindowsXP

Rootnoverify (hd0, 0)

Chainloader + 1

Therefore, I want to add password -- md5 $1 $7uDL20 $ eSB. XRPG2A2Fv8AeH34nZ0 to/etc/grub. conf, and where should I add the lock? Please refer to the following changes to the instance;

Timeout = 10

Splashimage = (hd0, 7)/boot/grub/splash.xpm.gz

Password -- md5 $1 $7uDL20 $ eSB. XRPG2A2Fv8AeH34nZ0

Title Fedora Core (2.4.22-1.2061.nptl)

Lock

Root (hd0, 7)

Kernel/boot/vmlinuz-2.4.22-1.2061.nptl ro root = LABEL =/

Initrd/boot/initrd-2.4.22-1.2061.nptl.img

Title WindowsXP

Rootnoverify (hd0, 0)

Chainloader + 1

Lock means that the Redhat Fedora is locked. If an error occurs during startup. Press the P key and then enter the password.

Use the password and lock commands to implement the following encryption methods:

1) encrypt the GRUB interface, instead of adding a line below the timeout line to encrypt the guided system: password -- md5 PASSWORD

2) encrypt the GRUB interface and add a line of password-md5 PASSWORD under the line of title to encrypt the guided system under the timeout line: lock

3) Multiple boot systems exist at the same time. encryption is performed on specific system instances (without GRUB operation interface encryption) by adding a line below the title line: lock is followed by another line below the lock Line: password -- md5 PASSWORD Note: lock cannot be used separately.

Let's take a closer look, from the above we modified/etc/grub. conf has used our first step through the/grub-md5-crypt generated password ?? Is it a bit secure?

Related Article

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.