ubuntu forget the password, the solution to forget the root password
Power on, select advanced options and press enter to enter the menu options.
Select the recovery mode line and press e to edit it.
Find the key line, change the parameters, and change ro recovery nomodeset to rw single init=/bin/bash
before
modification after modification. After
entering the interface, enter the passwd username and change the password. After the modification, restart it.
Modified! Leave your footprints, like it.
The following is the reference link https://www.cnblogs.com/relaxgirl/p/3179507.html