In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "Centos system how to set the GRUB boot menu password", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Centos system how to set the GRUB boot menu password" bar!
You need a password to modify a menu entry, but you do not need a password to start it; GRUB2 provides two types of password protection:
A password is required to modify a menu entry and start one, more, or all menu items.
Set the password when you modify a menu entry
Setting a password using grub2-setpassword prevents modification of GRUB menu entries, but does not prevent unauthorized startup. If you also need a password to start the entry, you need to modify the grub configuration file.
On RHEL 7.2and Centos 7 (and later), GRUB 2 uses the grub2-setpassword command to provide password protection.
[root@localhost grub.d] # grub2-setpasswordEnter password:Confirm password:
When you press e or c in the grub menu to edit, you are prompted that you need a user name and password to change it.
This process creates a / boot/grub2/user.cfg configuration file that contains the encrypted password. The user of this password is root, which is defined in the / boot/grub2/grub.cfg file. With this change, you need to specify a root username and password to modify the boot entry during boot.
Set the password when changing menu entries and starting menu entries
Edit the / boot/grub2/grub.cfg configuration file, search for the 10 _ linux keyword, and then modify the entry below to remove the-- unrestricted parameter so that you need to enter a user name and password to boot.
[root@localhost ~] # vim / boot/grub2/grub.cfg
Before modification
Configuration after the-unrestricted parameter is removed
After the modification is completed, save and exit, restart the operating system, and will be prompted to enter the account password when starting the system.
How to change a root user to another user?
The default setting in the Grub.cfg configuration file is the root user, and we can change it to another user.
Edit the / boot/grub2/grub.cfg configuration file, search for the 01 _ users keyword, and change the root to another user, which is changed to the "test" user name.
How do I delete a password?
To delete the password, simply delete the / boot/grub2/user.cfg file.
[root@localhost ~] # rm-rf / boot/grub2/user.cfg
Summary
You can use grub's password to protect startup entries and modify entry menus. The grub2-setpassword tool was added in RHEL7.2/Centos7.2 and is now the standard way to set the GRUB 2 password.
Thank you for your reading, the above is the content of "how to set the password of the GRUB boot menu in the Centos system". After the study of this article, I believe you have a deeper understanding of how to set the password of the GRUB boot menu in the Centos system. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.