Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to set grub password and single user login in centos7

Shulou Source: shulou.com Published: 2022-06-01 20:26:12 09月25日 Update

This article will explain in detail how to set the grub password and single user login for centos7. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

There is a big difference between centos7 and centos6 in the operation steps of setting grub password. This is a record for future reference.

Purpose of grub encryption: to prevent lawbreakers from using single-user mode to modify root passwords

There are two ways to encrypt grub: plaintext or encrypted ciphertext. It is recommended to use encrypted ciphertext. There is little difference between the two operation steps. This paper takes encrypted ciphertext as an example.

one。 Set grub encryption

1. Use the grub2-mkpasswd-pbkdf2 command to create ciphertext (save and remember the password you set)

two。 At the end of the / etc/grub.d/00_header file, add the following (root is the user name used for single user login, and the third line of root is followed by the encrypted ciphertext obtained in the previous step. Note that root and ciphertext are separated by spaces rather than newline characters)

Cat

Tags: Password encryption single user ciphertext login interface article system content command file more mode step user user name input photogenic good practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Tech Info vpn Xiaomi Huawei