[Cracking the password chapter 02] Single user cracking the root password

Single user cracking root password

method one

1. Restart the system
Insert picture description here

2. In the kernel interface (as shown above), press "e" to enter the edit mode (as shown below), position the cursor on the line linux16, add: init=/bin/sh at the end of the line, and then press ctrl+x
Insert picture description here
3. Rehang root in read-write mode

# mount  -o  remount.rw  /

Insert picture description here

4. Modify root password

5. If selinux is turned on, if not, skip this step

# touch /.autorelabel

6. Exit edit mode and restart

# exec /sbin/init

Finished, and then you can log in with the new root password.

Method Two

1. Restart the system Insert picture description here
2. In the kernel interface (as shown above), press "e" to enter the edit mode (as shown below), modify the kernel parameters, and then press ctrl+x
Insert picture description here
3. Re-hang the root in read-write mode

# mount  -o  remount.rw  /

Insert picture description here
4. Modify root password

5. If selinux is turned on, if not, skip this step

# touch /.autorelabel

6. Exit edit mode and restart

# exec /sbin/init

Finished, and then you can log in with the new root password.

Guess you like

Origin blog.csdn.net/qq_30566629/article/details/110234597