Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report