I have been writing articles related to linux for a long time. As a pseudo-technology developed by O & M personnel, I think linux is a future trend. Therefore, the first step of linux Password security is crucial, this article describes the linux Password Attack and Defense platform, Red Hat Linux (2.4.20-8 ).
Crack logon Password
GRUB: On the boot loader menu, type [e] to enter the editing mode. You will face a list of pilot projects. Find the line with the output similar to the following: kernel/vmlinuz-2.4.18-0.4 ro root =/dev/hda2 press the arrow keys until the line is highlighted and then press [e]. Now you can add a single entry at the end of the text to tell GRUB to guide the Linux mode of a single user. Press the [Enter] key to make the editing result take effect. You will be taken with the edit mode screen. From here, clicking GRUB will guide the single-user Linux mode. After loading, you will face a shell prompt similar to the following: sh-2.05 # now, you can change the root command and type: bash # passwd root you will be asked to retype the password for verification. After the password is changed, you can enter reboot at the prompt to reboot. Then, you can log on as the root user as usual. When the LILO boot screen appears after the LIL system is started, press TAB for the graphic Boot Mode to enter the text mode, and then enter linux single press enter at LILO to enter the password-free console, use the passwd command to change the root password.
Method 2: Choose grub-> linux-> select the intermediate item --- E ---> enter (/linux s init 1) at the prompt and press enter -- B --> restart, enter (vi/etc/passwd) at the prompt and remove the user's password transfer bit (x) and save it forcibly)-restart!
This is the most common and quickest method.
Prevent others from modifying passwords in single-user mode.
To guide the single-user mode, you must edit it in grub. Therefore, we only need to encrypt grub and prevent others from modifying grub.
The method is as follows:
1. grub has a configuration file in the/etc folder. The name is "grub. conf". Locate the file and use vi to edit it.
2. Let's take a look at the content in the file: (annotations are skipped)
Default = 0
Timeout = 10
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Title Red Hat Linux (2.4.20-8)
Root (hd0, 0)
Kernel/vmlinuz-2.4.20-8 ro root = LABEL =/
Initrd/initrd-2.4.20-8.img
For more information, see the grub documentation. Here we will add a password.
You can add a password in two places.
3. Add "password = 123456" (123456 is your password) under "timeout = 10 ). Save, exit, and restart. We can see that the grub interface cannot be modified by "e. To modify the password, press "p" to enter the password.
4. The second place is under "initrd/initrd-2.4.20-8.img. Add "password = 123456" here (123456 is your password ). Save, exit, and restart. We can see that there is another password before linux is started (after the grub interface. It is worth noting that this password can prevent entry in single-user mode. That is to say, even if we start the single-user mode by editing grub, we still need to enter this password.