In the Ubuntu 16.04 system, the administrator password is lost or invalid due to misoperation, and the root password is forgotten. At this time, no root/sudo privilege operations can be performed. You can reset the root password through GRUB and restore the administrator account to a normal state.
tool
• Ubuntu16.04 operating system
Reset root password
• Start the system, display the GRUB selection menu (long press the shift key), and enter the selection interface.
• Select (advanced settings) enter key
• Boot to select advanced mode -> recovery mode (the newest one) -> root (directly press enter)
• Set the password as required. Manage passwords.
Command: Passwd root # modify the password (the password modified here is not used)
• After modification, shut down and restart
• After re-entering the system, execute sudo passwd root to modify the password again. --The password is the new password
• carry out!