System Security and Application (c) grub menu restrictions

 Foreword

 Can be modified by the grub boot root password, so we have to create a convenient, if the password is forgotten, we can change the password through grub guide, but it also provides a convenient outsiders, by outsiders grub boot can enter the system and modify root password, this is a very serious danger. So we need to set a password to restrict grub menu.

1. Backup

cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bak

cp /etc/grub.d/00_header /etc/grub.d/00_header.bak

image.png

2. Generate keys

grub2-mkpasswd-pbkdf2

image.png

3. Modify the configuration file

vim /etc/grub.d/00_header

image.png


4. generate a new profile grub.cfg

-o-Grub2 mkconfig /boot/grub2/grub.cfg

image.png

5. Verify

Restart

QQ picture 20190827160717.png

QQ picture 20190827160627.png



Guess you like

Origin blog.51cto.com/14469918/2432981