Step 1: After the blue grub interface is started, use the up and down keys to quickly move the cursor to the second line.
... (Recovery mode)
Step 2: press the letter "E" to enter the editing page. On the seventh line, there is a line of "Linux/Vm... single ".
Add "init =/bin/bash" at the end (quotation marks cannot be omitted)
Step 3: press Ctrl + X to start the system and enter root @ (none): command line mode.
Step 4: run the command to make the system readable and writable # Mount-No remount, RW/
Step 5: The command not found is displayed in passwd, VI, and vim.
Use Debian's default text editor nano to edit the first line (root line) of/etc/shadow ), back up shadow
# cd/etc
# cp shadow. bak
# nano shadow
modify the first behavior of shadow: Root: 15198: 0: 99999: 7 ::: (clear the root password)
press Ctrl + X and select YES to save.
Step 6: Change the system to read-only. # Mount-No remount, RO/
Step 7: log on to the server as a normal user. # su directly enters the root user (no password is required).
Step 8: Use # passwd to reset the root password.