Linux password cracking and grub encryption demonstration
Demonstration of password cracking and grub Encryption
So easy, no!
Principle:
By entering the single-user mode (single-user mode means that only one user can access resources, and the single-user mode means that the system is in the original state, and most services are not enabled yet ), you can change the password.
Steps:
1,Press shift to enter the grub interface (grub is used as a boot loader, which can be similar to the Bios of a PC)
2,Move the keyboard up/down key to the recovery mode of the second line, and press e (note that it is not the Enter key)
3,Move the cursor to the last three lines and replace "ro recovery nomodeset" with "rw single init =/bin/bash"
4,Press Ctrl + x to enter the single user mode.
5,Enter the command to change the password: passwd + username (user to be modified)
Grub encryption:
· Note: grub can be encrypted to prevent others from modifying the password through the above method. If others do not know the account and password encrypted by grub, they cannot access grub.
Specific operations:
1. Create a ciphertext Password
Enter the command: grub-mkpasswd-pbkdf2
Prompt to enter the password to be encrypted, for example 123
Generate the password to be encrypted and copy it.
2. Modify/etc/grub. d/00_header and append it at the end:
Cat <EOF
Set superusers = "test" // test is the encrypted account set for grub
Password_pbkdf2 testgrub. pbkdf2.xxxxxxxx // The encrypted password above
EOF
3. Update grub
Enter the command: update-grub2
4. The next time you access grub, you must enter the grub account and password (for example, account test and password 123)