Boot management-boot boot program-grub encryption

Preface

Grub encryption and character interface resolution adjustment are small tricks in Linux.
The grub encryption is fine, but the character interface resolution adjustment is uncomfortable.

1. grub encryption

When booting up, press any key five seconds to enter this interface. There is only one operating system in the current virtual machine. If multiple operating systems are installed in the virtual machine, it may be Linux and Windows coexisting, or it may be installed. Two different versions of the Linux kernel can be selected in this interface. Which interface to start, this is the basic function of the grub bootloader, and it is also the basic function of choosing which system to enter.
Insert picture description here
e enter its edit mode

Insert picture description here
The three options under the kernel header boot interface are the three lines of the grub configuration file.
These three options are used to edit the boot function. It is actually very convenient to crack my current root password. At this time, you will feel that it is not very safe. You can enter the editing mode after booting and entering e. You can change anything you want. At this time, you can consider whether you can encrypt e and enter the correct password to enter the editing mode of grub. Expose it to the outside, it will be safer.

The point is, how to encrypt it? ? ?

Before redhat 6.0, the MD5 encryption mode was used. After Redhat 6.0, the encryption method used has been upgraded to SHA512. This refers to the system user name and password encryption. So far, grub encryption still uses MD5 encryption.

Grub encryption also does not allow you to write the plaintext password directly in the grub configuration file, and you need to convert the plaintext password into an MD5 encrypted password string before you can put it. At this time, you need to use the following command:

Command: grub-md5-crypt
Function: Generate an encrypted password string, put the generated password string into the grub configuration file, and place it under the timeout.

Start experimenting:

(1) Replace ordinary string with encrypted string

Insert picture description here
(2) Then put the converted encrypted string into the grub configuration file.

Insert picture description here
Insert picture description here
Insert picture description here
The editing mode of e is protected, and I feel more secure.

2. Pure character interface resolution adjustment

In use, you can use remote tools to manage this pure character interface. Both remote tools and graphical interfaces can easily adjust my resolution. But the resolution of the pure character interface is so large by default, and it looks a bit small. Can the resolution of the pure character interface be adjusted? Yes, this is a little trick, I adjusted it, the experience is not very good, it is more comfortable to use the remote connection. Moreover, in the actual use process, the graphical interface is not installed on the server, and there is no monitor, so adjusting the resolution is useless and meaningless. Generally, it is done by using remote tools.

The point is here, how to adjust the resolution? ? ?

(1) First check whether the kernel supports resolution modification, using the kernel configuration file to search for the same keyword in the compressed kernel, as long as there is proof, it is supported.

Insert picture description here
Command: grep "CONFIG_FRAMEBUFFER_CONSOLE" /boot/config-2.6.32-279.el6.i686
Function: Query whether the kernel supports resolution modification

(2) Resolution comparison table:

Just follow this table when adjusting.

Insert picture description here
To define the boot options of the kernel, add vga=791 after the boot options and restart. Then my Linux can comply with the resolution of 1024*768. Then restart it. The screen of the pure character interface will become larger, but the font will remain the same.

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_46818279/article/details/108206510