Enter single user mode:
After entering the startup screen, type “e”, move the cursor to the kernel… line, type “e” again, add a space single at the end of the kernel line, and press Enter
Type “b” to start the system and enter the single user mode.
At this time, you can use the passwd command to change the password.
Reboot after the change.
Enter lilo command line mode and type linux single to enter single user mode.
If you set a password for grub/lilo, you must remember it. If you forget the password for grub/lilo, you have to use rescue mode.