Get the App
SLTechnology News&Howtos  ›  Servers  › 

Security and Application of Centos7 system (3) grub menu restriction

Shulou Source: shulou.com Published: 2022-06-03 07:03:09 09月21日 Update

preface

The root password can be modified through grub boot, which is convenient for us. If the password is forgotten, we can modify the password through grub boot, but it also provides convenience for outsiders. Outsiders can enter the system and modify the root password through grub boot, which is a very serious danger. So you need to set a password to restrict the 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

2. Generate Key

grub2-mkpasswd-pbkdf2

3. modify the configuration file

vim /etc/grub.d/00_header

4. Generate a new grub.cfg configuration file

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

5. verification

restart

Tags: Password alien outsider file generation configuration system menu restriction danger preface can be passed backup this is authentication security application Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL MariaDB Shulou Tech Info Xiaomi Redmi