Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux enters single-user mode encryption

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

Linux enters single-user mode encryption

Text keywords: Linux, single user mode encryption, grub menu encryption, plaintext encryption, MD5 encryption

By default, the system runs at levels 3 (full multi-user mode) and 5 (operating mode with interface). In the previous article, we have introduced how to switch the system to single-user mode, where you can directly manipulate root users to reset passwords. So the problem is, since anyone who doesn't know the root password can reset the password in this way, our system is also dangerous. To avoid this problem, we need to impose some restrictions on entering single-user mode, that is, adding an extra layer of password authentication.

First, plaintext encryption 1. Profile modification related configuration file: / boot/grub/grub.conf

Configuration item name: password insert location: after splashimage configuration item example: set password to 123456

two。 The encryption effect cannot be edited directly after encryption. You need to press the letter p to enter the password.

Enter the correct password and pass the verification

The editing option appears, and you can continue to log in in single-user mode.

II. MD5 encryption

When encrypting, because it is plaintext, there is still a risk of direct exposure. There are many encryption tools that can be used directly in Linux system, such as MD5, SHA and so on.

1. Get encrypted string

Take the operation of using MD5 as an example, use the grub-md5-crypt command to get the encrypted string first.

two。 Profile modification

You need to use password-- md5 in the configuration room to specify the encryption method.

3. Encryption effect

Same as plaintext encryption, after setting up, you need to verify the password in the grub menu interface before you can enter the editing interface. It is important to note that you only need to enter the original string before encryption. The encryption method of md5 can ensure that the password in the configuration file will not be easily exposed, which can further improve security.

Tags: Encryption password mode configuration single user file method plaintext system character string interface input authentication danger effects user menu question run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Microsoft Apple Shulou Information macOS