Linux password cracking and grub encryption demonstration

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.