Detailed explanation: MD5 encryption method for Linux system GRUB

  
                  

1, use grub-md5-crypt to generate GRUB md5 password; use grub-md5-crypt to add password operation to GRUB password. For example, we want to set grub password to 123456, so we must first use md5 Encrypt the password 123456 [root@linux01 beinan]# /sbin/grub-md5-crypt Password: Enter 123456 Retype password here: Enter 123456 $1$7uDL20$eSB.XRPG2A2Fv8AeH34nZ0 $1$7uDL20$eSB.XRPG2A2Fv8AeH34nZ0 The value generated by grub-md5-crypt after adding a password. We have to write down this value, it is still a bit useful. 2, change /etc/grub.conf For example, the contents of my original /etc/grub.conf file are 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 So I have to add password in /etc/grub.conf — —md5 $1$7uDL20$eSB.XRPG2A2Fv8AeH34nZ0 This line, and lock, should be added to it, see the example change below; 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 to lock Redhat Fedora. If prompted, an error will be raised. At this point you should press the P key and enter the password. Use the password and lock commands to implement several encryption methods as follows: 1) Simply encrypt the GRUB interface without encrypting the system being booted. Add a line below the timeout line: password ——md5 PASSWORD 2) Encrypt the GRUB interface and boot at the same time The system encryption adds a line below the timeout line: password - md5 PASSWORD Add a line below the title line: lock 3) There are multiple guided systems at the same time, respectively for specific system instances (not encrypted for GRUB interface) Add a line below the line: lock is placed next to the lock line and add a line: password - md5 PASSWORD Note: lock can not be used alone. Let's take a closer look, from the above we changed /etc/grub.conf is not already Did you use the password generated by /grub-md5-crypt in the first step? ? Is it a little safe?


Copyright © Windows knowledge All Rights Reserved